|
-
Mar 10th, 2004, 11:42 AM
#1
Thread Starter
New Member
Find/Replace Loop - argh !
Hi there,
I am trying to run a simple macro (which I did by recording it) that looks for style "TableAnchor", replaces the line of it with another style, and puts another paragraph in after it in a third style.
No problems. But I want to do it for every instance of "TableAnchor" style. And I am stumped as to where and what sort of loop to use.
Any hints would be reaaaaaaaaallllllllly appreciated.
Here's my macro so far:
Sub replacingstyles()
'
' replacingstyles Macro
' Macro recorded 10/03/04 by elizabeth.dent
'
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("TableAnchor")
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.Style = ActiveDocument.Styles("Body Text")
Selection.EndKey Unit:=wdLine
Selection.TypeParagraph
Selection.Style = ActiveDocument.Styles("TableAnchor1point")
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|