I have a word document (actually a template) where I would like to
remove all the words with a prefix "$DOC$" (actually indicating an
unused tag). My first desired step is to look for these words and
replace them with an empty string. Some of these words are inside
tables. Could any one show me how to achieve it programmatically?
Any hint is a big help. Thank you in advance.
Tony
Search string = ($DOC$)([! ]{1,255})
Replace string = null or space
note: be sure you have [! ] not [!]
Thank you for the reply. I do need a piece of code in VBA (the best
in VC++). It is part of an existing software package. Any further
instruction is much appreciated.
Tony
Selection.HomeKey Unit:=wdStory
Selection.Find.Text = "($DOC$)([! ]{1,255})"
Selection.Find.Replacement.Text = ""
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.MatchWildcards = False
End Sub