F
Fuzzhead
I have converted documents from WordPerfect to Word and I am trying to drawn
a line in selected locations. Where ever I have 10 spaces I want to replace
it with no spaces and at that same location draw a line. Below is my macro
but it’s not working. What am I doing wrong?
Dim oFFline As Shape
Dim i
On Error GoTo Endthis
i = Selection.Information(wdVerticalPositionRelativeToPage)
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = " "
.Replacement.Text = ""
Set oFFline = ActiveDocument.Shapes.AddLine(554, i + 12, 524, i + 12)
oFFline.Name = "hline" & idx
idx = idx + 1
.Forward = True
.Wrap = wdFindContinue
Selection.Find.Execute Replace:=wdReplaceAll
Endthis:
a line in selected locations. Where ever I have 10 spaces I want to replace
it with no spaces and at that same location draw a line. Below is my macro
but it’s not working. What am I doing wrong?
Dim oFFline As Shape
Dim i
On Error GoTo Endthis
i = Selection.Information(wdVerticalPositionRelativeToPage)
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = " "
.Replacement.Text = ""
Set oFFline = ActiveDocument.Shapes.AddLine(554, i + 12, 524, i + 12)
oFFline.Name = "hline" & idx
idx = idx + 1
.Forward = True
.Wrap = wdFindContinue
Selection.Find.Execute Replace:=wdReplaceAll
Endthis: