Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Using line spacing in VBA/word 2007


John T.
 Share

Recommended Posts

I'm not sure if I'm understanding the various LineSpacingRule commands for use with VBA in word 2007 to get a doc sheet made up.

The issue is that I'm not getting proper line spacing. It seems to be defaulting to the double spacing default of word 2007.

Here's some snippets:

 

In my defintions-note thatI'm not sure what the value really is supposed to be.

 

Const wdLineSpace1pt5=1

Const wdlineSpaceSingle=0

Const wdLineSpaceExactly=0

 

Here is a part of someting that gets printed out in word:

 

.ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, 20,70, 222.3, 65).Select 'first box left side

.Selection.ShapeRange.TextFrame.TextRange.Select 'First box header info goes this section

.Selection.ParagraphFormat.LineSpacingRule=wdLineSpaceSingle

.Selection.Collapse

.Selection.ShapeRange.Line.Visible = msoFalse

.Selection.Font.Bold=True

.Selection.TypeText "Company: "&vbTab 'Company Name

.Selection.Font.Bold=False

.Selection.TypeText companyname&vbNewLine

.Selection.Font.Bold=True

.Selection.TypeText "Description: "&vbTab 'Description

.Selection.Font.Bold=False

.Selection.TypeText Description &vbNewLine

.Selection.Font.Bold=True

.Selection.TypeText "PI Num: "&vbTab 'PI number

.Selection.Font.Bold=False

.Selection.TypeText Program &vbNewLine

.Selection.Font.Bold=True

.Selection.Font.Bold=True

.Selection.TypeText "Material: "&vbTab 'Material type IF in Job setup

.Selection.Font.Bold=False

.Selection.TypeText material &vbNewLine

 

I guess my biggest problem is I don't know how the constants are defined, or if I'm using the

 

.Selection.ParagraphFormat.LineSpacingRule=wdLineSpaceSingle

 

In the proper place.

 

Any ideas?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...