• Word 2010 Formatting Text Box Alignment w/Macro

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Word 2010 Formatting Text Box Alignment w/Macro

    Author
    Topic
    #497488

    I can insert a textbox using a macro with Shapes.AddTextBox, but the options are limited to Left, Top, Width, and Height. If I right-click the box, I get many more Position Layout options, including making the box horizontally align to the right relative to the outside margin. How can I do this in a macro? I ran across RelativeHorizontalPosition = wdRelativeHorizontalPositionOuterMarginArea may help, but I don’t think it’s exactly what I’m looking for. I can’t find a specific option to Align or Position relative to the right margin. I’d also like to make it veritically align relative to top of the page. Any suggestions of additional options/methods to set these alignment properties for the inserted textbox?

    Thanks.

    Viewing 0 reply threads
    Author
    Replies
    • #1477093

      I think I found the answer. Using the following works (vBox is my Shape):

      Code:
         With vBox
              .RelativeHorizontalPosition = wdRelativeHorizontalPositionOuterMarginArea
              .Left = wdShapeRight
              .RelativeVerticalPosition = wdRelativeVerticalPositionPage
              .Top = wdShapeTop
          End With

      As sometimes happens, I figured it out after posting the question. 😉

      Thanks.

    Viewing 0 reply threads
    Reply To: Word 2010 Formatting Text Box Alignment w/Macro

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: