• Macro to Clear Tabs, Word XP

    Author
    Topic
    #464657

    Sometimes I’ll get a document that someone has put over 20 tabs on the ruler. Is there any VBA code that can clear all the tabs in the ruler on every line and just set one tab at 1.25 inches on each line?

    I know I’ll have to go through the document to make sure everything is formatted correctly and insert proper tabs and sometimes remove tab characters. I won’t know if it’s worth it until I can create the macro.

    Viewing 1 reply thread
    Author
    Replies
    • #1190315

      Here is a macro:

      Code:
      Sub ClearSetTabs()
        With ActiveDocument.Paragraphs.TabStops
          .ClearAll
          .Add Position:=Application.InchesToPoints(1.25)
        End With
      End Sub
      

      This will act on the entire document. If you’d prefer the macro to act on the currently selected text only, change ActiveDocument to Selection.

      • #1190324

        Here is a macro:

        Code:
        Sub ClearSetTabs()
          With ActiveDocument.Paragraphs.TabStops
            .ClearAll
            .Add Position:=Application.InchesToPoints(1.25)
          End With
        End Sub
        

        This will act on the entire document. If you’d prefer the macro to act on the currently selected text only, change ActiveDocument to Selection.

        Thank you Hans for this help. If it becomes too difficult to reformat the document after I clear the tabs for all the lines then I’ll use your second option of clearing the selected text. I have the feeling I may have to do the later option but I won’t know until I run the macro and see the results (gulp). It may be too much to do. The documents usually run around 30-50 pages.

        Thanks again.

    • #1207127

      If you don’t do this regularly, you don’t need a macro.

      1. Highlight the document (CTRL-A) or the section you want to clear the tabs from.
      2. Go to Paragraph Format.
      3. Click on Tabs.
      4. Click on Clear All and OK.

    Viewing 1 reply thread
    Reply To: Macro to Clear Tabs, Word XP

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

    Your information: