Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Do I Set Font Size in WP DOC using Automation

Status
Not open for further replies.

as01283

Technical User
May 22, 2008
2
US
I am trying to change the font size from my vb net program.

I am using:

[tt]
Dim objWordPerfect As Object
objWordPerfect = CreateObject("WordPerfect.PerfectScript")
objWordPerfect.LabelsSelect("D:\Users\Alan\AppData\Roaming\Corel\WordPerfect\16\EN\Labels\Avery Labels EN.lab", "Avery 5160 Address Labels")
objWordPerfect.PaperSizeSelect("Avery 5160 Address Labels", 8.5, 11.0, 4)

SetFontSize(10)
objWordPerfect.Type("this should be font size 10")
objWordPerfect.HardReturn()
SetFontSize(12)
objWordPerfect.Type("this should be font size 12")
objWordPerfect.HardReturn()

:
:
Private Sub SetFontSize(FontSize As Integer)
Dim WpFontSizeParameter As Single
Select Case FontSize
Case 10 : WpFontSizeParameter = 0.138
Case 11 : WpFontSizeParameter = 0.153
Case 12 : WpFontSizeParameter = 0.167
Case 14 : WpFontSizeParameter = 0.194
Case Else
Debug.Print("No Font Size for FONT: " & FontSize)
Stop
End Select
objWordPerfect.FontSize(WpFontSizeParameter)
End Sub
[/tt]

I have been able to change to font family, bold, italic etc, but the FONT SIZE just doesn't seem to work (reveal codes dont show anything where the size should go.

Can anyone shed some light on this?
 
I found problem

fontsize needs to be an integer.


FontSize 12 = 200
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top