![]() |
#2
|
||||
|
||||
![]()
Start off by hiding all text, then unhiding the paragraphs containing the found text. There is no need to do any looping:
Code:
Sub Demo() Application.ScreenUpdating = False StrFnd = InputBox("Find Text with Wildcard") If Trim(StrFnd) = "" Then Exit Sub With ActiveDocument.Range .Font.Hidden = True With .Find .ClearFormatting .Replacement.ClearFormatting .Text = "[!^13]@" & StrFnd & "*^13" .Font.Hidden = True .Replacement.Font.Hidden = False .Replacement.Text = "^&" .Forward = True .Wrap = wdFindContinue .Format = True .MatchWildcards = True .Execute Replace:=wdReplaceAll End With End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
miscia76 | Word | 1 | 11-13-2013 04:29 PM |
Show & hide paragraphs, parts of tables, etc | Preloader | Word | 2 | 10-19-2013 02:37 PM |
![]() |
pgwolfe | Word | 3 | 09-24-2013 07:58 PM |
the macro cannot be found or has been disabled | map7 | Word | 10 | 04-10-2012 01:40 PM |
![]() |
geobruin | Word | 1 | 06-12-2009 06:55 AM |