Print Left Margin In Vb6
Help. Re: VB6; Im trying to create a one inch left margin from the papers left edge when I print data from a textbox. The problem Im having is that it will only print the first line, one inch in from the papers left edge. All of the following lines are only printed a quarter inch in from the left edge of the paper.
The code Im using follows below:
Printer.Print
Printer.CurrentX = 1440
Printer.CurrentY = 1440
a$ = Text1.Text
Printer.Font = "arial"
Printer.FontSize = 12
Printer.Print a$
Printer.EndDoc
Text1.Text box is set to multiline; alignment is left justified; enabled=true. The entire program works fine except for this minor problem. The program is basically a text box that accepts text into it. The data can then be Saved, Opened, Cleared or Printed. Hope someone can help!
Dan
P.S. In writing this Post in the Edit Post window I tried to show the actual print output and desired print output, but I had problems using TAB or INDENT, neither would work.
[1045 byte] By [
Urbaud] at [2007-11-11 7:37:49]

# 1 Re: Print Left Margin In Vb6
the newline in the text resets the value of CurrentY to zero, this is why only the first line is indented. You must set the scaleleft value to -1inch, so that the zero position is one inch from the margin:
Printer.ScaleMode = vbInches
Printer.Scaleleft = -1
Printer.Scaletop = -1
Printer.Currentx = 0
printer.currenty = 0
Printer.Print Text1.Text
Printer.Enddoc
code not tested.
Marco
mstraf at 2007-11-11 17:26:46 >
