L
LEU
I was working with Russ on this but I had a family emergency and gone for 5
days. I have the following macro but can’t get it to work right. When I run
the macro for example it converts "^dLISTNUM 24 \l 2" to the word "Heading
2". It doesn't see that as an Outline Number style and make it “1.2â€.
Dim SearchRange As Range
Set SearchRange = ActiveDocument.Range
SearchRange.TextRetrievalMode.IncludeFieldCodes = True
With SearchRange.Find
.Forward = True
.Wrap = wdFindStop
.ClearFormatting
.Format = True
.Text = "^dLISTNUM ^#^# \l ^#"
.Replacement.Text = ""
While .Execute
SearchRange.Text = "Heading " & SearchRange.Characters.Last.Previous
SearchRange.Select
Selection.Style = ActiveDocument.Styles("Heading " & _
SearchRange.Characters.Last)
SearchRange.SetRange Start:=SearchRange.End, _
End:=ActiveDocument.Range.End
Wend
End With
LEU
days. I have the following macro but can’t get it to work right. When I run
the macro for example it converts "^dLISTNUM 24 \l 2" to the word "Heading
2". It doesn't see that as an Outline Number style and make it “1.2â€.
Dim SearchRange As Range
Set SearchRange = ActiveDocument.Range
SearchRange.TextRetrievalMode.IncludeFieldCodes = True
With SearchRange.Find
.Forward = True
.Wrap = wdFindStop
.ClearFormatting
.Format = True
.Text = "^dLISTNUM ^#^# \l ^#"
.Replacement.Text = ""
While .Execute
SearchRange.Text = "Heading " & SearchRange.Characters.Last.Previous
SearchRange.Select
Selection.Style = ActiveDocument.Styles("Heading " & _
SearchRange.Characters.Last)
SearchRange.SetRange Start:=SearchRange.End, _
End:=ActiveDocument.Range.End
Wend
End With
LEU