Thread: [Solved] Help with tabs
View Single Post
 
Old 01-21-2011, 03:38 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi kapnasty,

Try the following macro:
Code:
Sub IndentToTab()
Dim oPara As Paragraph, i As Integer, StrInd
StrInd = Split("0,0.38,0.75,1.13,1.5,1.88,2.25,2.63,3,3.38,3.75,4.13,4.5,4.88", ",")
With ActiveDocument
  For Each oPara In .Paragraphs
    With oPara
      If .LeftIndent > 0 Then
        For i = 1 To UBound(StrInd)
          .Range.InsertBefore vbTab
          If .LeftIndent <= InchesToPoints(StrInd(i)) Then Exit For
        Next i
        .LeftIndent = 0
      End If
    End With
  Next
End With
End Sub
Note: I've assumed you indent measurements are in inches. If they're in centimeters, change 'InchesToPoints' to 'CentimetersToPoints'.

If you need to see how to install & run a macro, go to: http://www.gmayor.com/installing_macro.htm
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote