|
-
Mar 26th, 2015, 06:59 AM
#1
[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
Lottery is a tax on people who are bad at maths
If only mosquitoes sucked fat instead of blood...
To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)
-
Mar 26th, 2015, 07:53 AM
#2
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
-
Mar 26th, 2015, 08:36 AM
#3
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.
Lottery is a tax on people who are bad at maths
If only mosquitoes sucked fat instead of blood...
To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)
-
Mar 26th, 2015, 09:27 AM
#4
Re: Printer.Font.Underline not working
Indeed... I have tried out a different pdf converter and it works fine.
 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.
Lottery is a tax on people who are bad at maths
If only mosquitoes sucked fat instead of blood...
To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)
-
Mar 26th, 2015, 01:14 PM
#5
Re: Printer.Font.Underline not working
Moreover:
The code works on a different computer where that pdf converter' version is different.
Lottery is a tax on people who are bad at maths
If only mosquitoes sucked fat instead of blood...
To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)
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
|