1 Attachment(s)
[RESOLVED] Printer.Font.Underline not working
In the following code the Underline property is not behaving correctly. See the result in the screen shot below. I've tried with different fonts and only 'Symbol' worked.
Printer is the default printer, a pdf writer.
Code:
With Printer
.ScaleMode = vbMillimeters
.Font = "Arial"
.Font.Size = 14
s = "Test Title"
.CurrentX = 0.5 * (.ScaleWidth - .TextWidth(s))
.CurrentY = 10
.Font.Underline = True
Printer.Print s
.Font.Underline = False
Printer.Print
.Font.Size = 12
.CurrentX = 20
Printer.Print "Date: " & Format(Date, "dd-mm-yyyy")
.EndDoc
End With
Attachment 125077
Re: Printer.Font.Underline not working
When I replace the Printer object with the current form then it seems to work.
Code:
Dim s As String
With Me
.ScaleMode = vbMillimeters
.Font = "Arial"
.Font.Size = 14
s = "Test Title"
.CurrentX = 0.5 * (.ScaleWidth - .TextWidth(s))
.CurrentY = 10
.Font.Underline = True
Print s
.Font.Underline = False
Print
.Font.Size = 12
.CurrentX = 20
Print "Date: " & Format(Date, "dd-mm-yyyy")
End With
Re: Printer.Font.Underline not working
Yes, the problem is only when I use the printer.
Actually I have checked that it does work on a real printer. The trouble seems to be associated to the specific pdf converter I'm using.
Definitely the VB code seems to be OK.
Re: Printer.Font.Underline not working
Indeed... I have tried out a different pdf converter and it works fine.
Quote:
Originally Posted by
Me
Yes, the problem is only when I use the printer.
Actually I have checked that it does work on a real printer. The trouble seems to be associated to the specific pdf converter I'm using.
Definitely the VB code seems to be OK.
Re: Printer.Font.Underline not working
Moreover:
The code works on a different computer where that pdf converter' version is different.