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

Can I set landscape in a text file by VB code?

Status
Not open for further replies.

acjeff

Programmer
Aug 10, 2004
148
US
In VB6, I am exporting data to a text file like this:

Open cdlSaveAs.FileName For Output As #1
Print #1, myData1
Close #1
ShellExecute vbNull, "open", cdlSaveAs.FileName, vbNull, vbNull, 1

How can I make the file page setup to be landscape?
 
A text file has no knowledge of whether it's landscape or portrait. It's only when you come to print it to a real printer that you can specify this. You could for example open the file in Notepad and then specify 'Landscape' in the printer properties before printing it for real.

Don't be fooled by the 'Print' statement. All that does is write the data to the file. It's a hangover from the days when Basic was first developed and it meant 'print this data onto the teletype you're using to write this program'

Later the teletype became a VDU but the statement persisted in the language.


Bob Boffin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top