Results 1 to 3 of 3
  1. #1
    3 Star Lounger MacroAlan's Avatar
    Join Date
    Feb 2003
    Location
    St Louis, Missouri, USA
    Posts
    254
    Thanks
    6
    Thanked 1 Time in 1 Post

    VBA in Word 2010: Set the tab position

    Figured out how to lay down two pieces of text from a userform. Now I need to set the tab position for one of them so that it is Right-justified at 7.5 inches.

    Code:
    Sub RunInsertTop()
        Selection.Font.Size = 16
        Selection.Font.ColorIndex = wdDarkRed
        Selection.Font.Bold = True
        Selection.TypeText Text:=usrFormatHeadings.txtTopLeft & vbTab
    Alan

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    Have you tried recording a macro to see what that code looks like?

    Selection.ParagraphFormat.TabStops.Add Position:=InchesToPoints(7.5), _
    Alignment:=wdAlignTabLeft, Leader:=wdTabLeaderSpaces
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. The Following User Says Thank You to Andrew Lockton For This Useful Post:

    MacroAlan (2015-01-13)

  4. #3
    3 Star Lounger MacroAlan's Avatar
    Join Date
    Feb 2003
    Location
    St Louis, Missouri, USA
    Posts
    254
    Thanks
    6
    Thanked 1 Time in 1 Post
    Tried recording but what I got was worthless.

    I've been doing Excel and Access VBA for years. The syntax is all different.
    Last edited by MacroAlan; 2015-01-13 at 20:59. Reason: left something off
    Alan

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •