Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA help, starter needed for export to txt 1

Status
Not open for further replies.

riddlermarc

Technical User
Joined
Aug 26, 2003
Messages
1
Location
GB
Hi,

n00b to Tek-Tips so apologies if I step on anybody's toes etc :)

I'm wanting to write a macro for a Busines Object report that will save each of the included tabs to a specified place, with the filename of {tab_name}.txt.

eg.

Three tabs called HQ, Southern, Great Western.
I want to save the first one as \\server\location\HQ.txt, then the second as \\server\location\Southern.txt and so on.. anyone able to help, please? I have spent the last 20mins Googling for BO/VBA help but nothing is forthcoming - can anyone also give me pointers as to where I can learn, please? I am a web developer by trade, just having to run a few BO reports for some functionality.

Kind regards,
Marc McAllister
 
Marc,

Here is the code

Code:
Sub ExportTxt()
    For i = 1 To ActiveDocument.Reports.Count
        ActiveDocument.Reports.Item(i).ExportAsText ("\\server\location\" & ActiveDocument.Reports.Item(i).Name)
    Next
End Sub

Good Luck
Sri
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top