Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Oct 2001
    Location
    Asheville, North Carolina, USA
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    help creating a macro (Word 2000)

    I need some guidance on how to create a macro for Word that will do what the doubleindent button did in WordPerfect (indent equally from both right and left margins). I really don't know where to begin! Thanks! <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: help creating a macro (Word 2000)

    To create a macro:
    <UL><LI>Select Tools/Macro/Macros...
    <LI>Type a name in the "Macro name" box, say IndentEqual
    <LI>In the "Macros in" combo box, select the name of the document or template you want to save the macro in
    <LI>Click "Make"[/list]You will be taken to the Visual Basic Editor, and the skeleton of your macro will be there, ready for you to type instructions. the line starting with an apostrophe ' are comments.

    Between the "Sub IndentEqual" and "End Sub", type:

    Dim conIndent As Single
    conIndent = InchesToPoints(0.5)
    With Selection.ParagraphFormat
    .LeftIndent = .LeftIndent + conIndent
    .RightIndent = .RightIndent + conIndent
    End With

    This will increase the left and right margin by 0.5 inch. You can replace it by any value you like.

    To call this macro:
    <UL><LI>Select (in Word) Tools/Macro/Macros...
    <LI>Select the name of your macro from the list
    <LI>Click "Run"[/list]You can also assign the macro to a toolbar button and/or keyboard shortcut.

    If you want a second macro to unindent, you can follow the same procedure, but use
    - conIndent
    instead of
    + conIndent

    (You can also copy and paste the first macro in the VB Editor, change the name of the copy to UndentEqual, and replace + by -)

  3. #3
    New Lounger
    Join Date
    Oct 2001
    Location
    Asheville, North Carolina, USA
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: help creating a macro (Word 2000)

    Thank you. That worked perfectly!

Posting Permissions

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