×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How Do I Set Font Size in WP DOC using Automation

How Do I Set Font Size in WP DOC using Automation

How Do I Set Font Size in WP DOC using Automation

(OP)
I am trying to change the font size from my vb net program.

I am using:


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


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?

RE: How Do I Set Font Size in WP DOC using Automation

(OP)
I found problem

fontsize needs to be an integer.


FontSize 12 = 200

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close