![]() |
#2
|
||||
|
||||
![]()
Hi mtames1,
Perhaps you could explain what you're trying to achieve with the various kinds of tags. It appears you want to keep all except the '<$I[cat]' and '>' of some, but only a lesser portion of others. If all the tags are all in the format you've described, a single wildcard Find can locate them all. For example: Find = \<$I\[cat\]([!\>]{1,})\> Replace = \1 Also, your code has a lot of redundacy in it - there is no need to keep setting the Find/Replace parameters. For example: Code:
... Dim myField As Field With Selection.Find .ClearFormatting .Replacement.ClearFormatting .Forward = True .Wrap = wdFindStop .Format = True .MatchCase = False .MatchWholeWord = False .MatchAllWordForms = False .MatchSoundsLike = False .MatchWildcards = False .Text = "><" .Replacement.Text = "> */-/* <" .Execute Replace:=wdReplaceAll .Replacement.Style = ActiveDocument.Styles("Big Yellow") .Text = "[\<]$I\[cat\]([0-9A-Za-z,\-\(\) ]{1,})\[([0-9A-Za-z,\-\(\) ]{1,})\][\>]" .Replacement.Text = " \1" .Execute Replace:=wdReplaceAll .Text = "[\<]$I)[cat\]([0-9A-Za-z,\-\(\) ]{1,})\[([0-9A-Za-z,\-\(\) ]{1,})\];([0-9A-Za-z,\-\(\) ]{1,})\[([0-9A-Za-z,\-\(\) ]{1,})\][\>]" .Replacement.Text = " \1:\3" .Execute Replace:=wdReplaceAll End With myCharStyle = "Big Yellow" ...
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
arrigo | Outlook | 1 | 12-07-2010 09:13 PM |
Indexing in document | rafikul | Word | 0 | 12-17-2009 11:07 PM |