|
-
Aug 14th, 2009, 03:23 AM
#1
Thread Starter
Junior Member
Change Printer orientation
Code:
Dim Prn As Printer
prn.Orientation = vbPRORLandscape 'or vbPRORPortrait
Shell("Notepad.exe " & myTextFile, vbNormalfocus)
I found some code this is what i have so far. What i need is to change the orientation i am assuming the second line changes the orientation of the default printer. Then Shell will open the specified text file (myTextFile) in notepad... and then once print is clicked in notepad it should print in the Orientation that it has been set to. Is it right to assume that, thats what will happen?
Im not at home right now and cant test it but is my logic right?
-
Aug 14th, 2009, 04:43 PM
#2
Re: Change Printer orientation
no
notepad will use the default settings of the printer, only documents printed from your program will be in landscape
check out the code here to change the default settings or a windows printer, it is specifically for duplex but landscape would need only minor changes
http://www.vbforums.com/showpost.php...8&postcount=11
remember to change back after use
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|