G
gaubahn via OfficeKB.com
hello to all,
im new to making macro and i mostly rely on Microsoft Word's Macro Recorder
for the basic layout of the Macro and from there i just make few adjustments
through Microsoft Visual Basic...and right now i find myself stuck and im
hoping for some professional help here which will be greatly appreciated.
Here's what im trying to do:
1. Look for any line in the document with a Tab Stop 3.5"
2. Indent everything in that line to 3.76"
here is the Macro
Sub Macro()
Selection.Find.ClearFormatting
Selection.Find.ParagraphFormat.TabStops.ClearAll
Selection.Find.ParagraphFormat.TabStops.Add Position:=InchesToPoints(3.5),
_
Alignment:=wdAlignTabLeft, Leader:=wdTabLeaderSpaces
Selection.Find.ParagraphFormat.Borders.Shadow = False
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.ParagraphFormat.TabStops(InchesToPoints(3.5)).Position = _
InchesToPoints(3.76)
End Sub
the problem with this is once i execute it the Tab Stop of the line where my
cursor is located is set to 3.76"
once again thanks in advance for your help.
im new to making macro and i mostly rely on Microsoft Word's Macro Recorder
for the basic layout of the Macro and from there i just make few adjustments
through Microsoft Visual Basic...and right now i find myself stuck and im
hoping for some professional help here which will be greatly appreciated.
Here's what im trying to do:
1. Look for any line in the document with a Tab Stop 3.5"
2. Indent everything in that line to 3.76"
here is the Macro
Sub Macro()
Selection.Find.ClearFormatting
Selection.Find.ParagraphFormat.TabStops.ClearAll
Selection.Find.ParagraphFormat.TabStops.Add Position:=InchesToPoints(3.5),
_
Alignment:=wdAlignTabLeft, Leader:=wdTabLeaderSpaces
Selection.Find.ParagraphFormat.Borders.Shadow = False
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.ParagraphFormat.TabStops(InchesToPoints(3.5)).Position = _
InchesToPoints(3.76)
End Sub
the problem with this is once i execute it the Tab Stop of the line where my
cursor is located is set to 3.76"
once again thanks in advance for your help.