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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA DoCmd.OutputTo equvalent in VB?

Status
Not open for further replies.

mych

Programmer
May 20, 2004
248
GB
Hi,

I'm trying to output to a text file in VB6.

In VBA I would have used...
Code:
DoCmd.OutputTo acOutputReport, "RptName", acFormatTXT, "TextFilePathAndName", 0

In VB6 I have a variable string that I just want to save as a txt file. What command(s) would I use to achieve this.

Many Thanks
 
Hi,

How about something like this:
Code:
Dim strNotepadFile as String

strNotepadFile = "Where the file you want to create goes"

Open strNotepadFile For Output As #1
Print #1, <Your String Variable>
Close #1
Hope this helps

Harleyquinn

---------------------------------
For tsunami relief donations
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top