Results 1 to 8 of 8
  1. #1
    Star Lounger
    Join Date
    Feb 2003
    Location
    near Blairgowrie, Perthshire, Scotland
    Posts
    72
    Thanks
    0
    Thanked 0 Times in 0 Posts

    changing tabs (xp)

    I have discovered after much pain that I can select a vertical column of text over several paras containing tabs (using Alt plus mouse pointer), go to Format, Paragraph, select Tabs and change the alignment from left to, say, decimal or right of a specified tab. Surely there's a way to select a whole chunk of text and replace all the left tabs over any number of paras with decimal or whatever or am I missing something/crying for the moon?

    Rex Last

    PS Congrats to Hans V and thanks for his answers in the past/present/future.

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

    Re: changing tabs (xp)

    I don't think there is an easy way to do that. It would be possible to write a macro to replace left-aligned tabs with decimal tabs, for example.

  3. #3
    Star Lounger
    Join Date
    Feb 2003
    Location
    near Blairgowrie, Perthshire, Scotland
    Posts
    72
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: changing tabs (xp)

    Thanks. That's what I feared. How are the various tabs exposed to VBA, please? Can't seem to find it in Help.

    Rex Last

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

    Re: changing tabs (xp)

    I'll look into your question later, if nobody else replies in the meantime.

  5. #5
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: changing tabs (xp)

    Sub ShowTabstopTypes()

    Dim tbstop As TabStop
    Dim strTablist As String

    For Each tbstop In Selection.Paragraphs(1).TabStops
    Select Case tbstop.Alignment
    Case wdAlignTabBar
    strTablist = strTablist & "Bar Tab at " & Str(tbstop.Position) & vbCrLf
    Case wdAlignTabCenter
    strTablist = strTablist & "Center Tab at " & Str(tbstop.Position) & vbCrLf
    Case wdAlignTabDecimal
    strTablist = strTablist & "Decimal Tab at " & Str(tbstop.Position) & vbCrLf
    Case wdAlignTabLeft
    strTablist = strTablist & "Left Tab at " & Str(tbstop.Position) & vbCrLf
    Case wdAlignTabList
    strTablist = strTablist & "List Tab at " & Str(tbstop.Position) & vbCrLf
    Case wdAlignTabRight
    strTablist = strTablist & "Right Tab at " & Str(tbstop.Position) & vbCrLf
    End Select
    Next tbstop
    MsgBox strTablist
    strTablist = ""
    End Sub

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

    Re: changing tabs (xp)

    In general, it is advisable to use styles to control the placement of tab stops. If you modify the style, the changes will automatically be applied to all paragraphs formatted with that style.
    If you have set tab stops directly, you can use the following macro to change all custom left-aligned tabs to decimal tabs; it's easy to modify the code to work with other types of tabs.

    Sub ChangeTabs()
    Dim par As Paragraph
    Dim tbs As TabStop
    For Each par In Selection.Paragraphs
    For Each tbs In par.TabStops
    If tbs.Alignment = wdAlignTabLeft And tbs.CustomTab Then
    tbs.Alignment = wdAlignTabDecimal
    End If
    Next tbs
    Next par
    End Sub

    The code acts on the paragraphs in the current selection.

  7. #7
    Star Lounger
    Join Date
    Feb 2003
    Location
    near Blairgowrie, Perthshire, Scotland
    Posts
    72
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: changing tabs (xp)

    Thanks to both. Perhaps a simple way of doing this could be on a future wishlist? Like ^tl ^te ^tr ^td ^tb for the variations on the tab?

    Rex Last

  8. #8
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: changing tabs (xp)

    Microsoft seems to have higher priorities than making Find and Replace more powerful. Like rearranging all the menus and toolbars. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    I'm not sure about your document, but in general, I find it handy to change "ad hoc" tabs (tabs not part of a style definition) using the Ruler. If you move the unwanted tab stop a bit to the left, then insert the desired tab in the desired position, then drag the unwanted tab stop off the ruler, you can "swap" tab types pretty quickly.

Posting Permissions

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