|
-
Jun 3rd, 2005, 03:18 PM
#1
Thread Starter
Fanatic Member
CurrentX with Printer Object [RESOLVED]
Hello All!
I've decided that I'm VB-enough to try a stab at using the Printer Object. I'm learning all the ins and outs, and trying out lots of test code.
In my example, I have set the page Height and Width, and am able to get the proper justification.
Similarly, I've found that if I use repeating lines of
VB Code:
Printer.Print "This is one line of text..."
Printer.Print "This is another line of text..."
Printer.Print "This is still yet ANOTHER line of text..."
Printer.Print "ANOTHER VARIANT MAY BE ALL CAPS!"
Printer.Print "ANoTHEr MaY hAVe A MIxtuRe of CApS and NoN-CaPs!?"
And the next line happens to be over the page border I've set, it will automatically put in a NewPage.... I wonder if that's good or not.
Anyway, my real question is. I want to set a border up, of say, .5 inches (720 twips) on the left and right margins. Do I have to put:
before each line, or is there a simplier way? It gets VERY redundant!
RESOLVED: ScaleMode did it!
Any ideas would be helpful! Thanks!
Last edited by mateo107; Jun 4th, 2005 at 02:09 PM.
Reason: RESOLVED
-
Jun 3rd, 2005, 06:04 PM
#2
Re: CurrentX with Printer Object
From MSDN
Scale Properties
The Printer object has these scale properties:
- ScaleMode
- ScaleLeft and ScaleTop
- ScaleWidth and ScaleHeight
- Zoom
The ScaleLeft and ScaleTop properties define the x- and y-coordinates, respectively, of the upper-left corner of a printable page. By changing the values of ScaleLeft and ScaleTop, you can create left and top margins on the printed page. For example, you can use ScaleLeft and ScaleTop to center a printed form (PFrm) on the page using these statements:
Printer.ScaleLeft = -((Printer.Width - PFrm.Width) / 2)
Printer.ScaleTop = -((Printer.Height - PFrm.Height) _
/ 2)
-
Jun 4th, 2005, 05:47 AM
#3
Re: CurrentX with Printer Object
You can also set the paper size if it is a predefined standard size:
VB Code:
'e.g. Set papersize to A4
Printer.PaperSize = vbPRPSA4
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
|