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 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?