![]() |
#6
|
|||
|
|||
![]()
RobiNew, what do you mean by "extract": hilighting, msgboxing, adding to a collection, deleting...? For me your task is not quite clear.
If you need to hilight the found strings, you may use the followng code, which was once made by gmaxey and slightly modified by me: Sub Hilite_Array_T() 'In selection, hilite all instances of 'width=' and 'height=' followed 'by three-digit numbers. Application.ScreenUpdating = False Dim vFindTxt As Variant Dim oRng As range Dim i As Long vFindTxt = Array("width=", "height=") For i = 0 To UBound(vFindTxt) Set oRng = selection.range With oRng.Find .ClearFormatting .Replacement.ClearFormatting Do While .Execute(FindText:=vFindTxt(i), _ MatchWholeWord:=True, _ Forward:=True, _ Wrap:=wdFindStop) = True And _ oRng.End <= selection.range.End oRng.MoveEnd unit:=wdCharacter, count:=3 oRng.HighlightColorIndex = wdYellow oRng.Collapse wdCollapseEnd Loop End With DoEvents Next lbl_Exit: Set oRng = Nothing Exit Sub Application.ScreenUpdating = True End Sub |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to hide/delete slides based on keyword in a separate text file based on AND|OR condition? | rupd911 | PowerPoint | 0 | 02-22-2021 08:22 AM |
![]() |
commissarmo | Word VBA | 3 | 03-14-2015 12:53 AM |
![]() |
officeboy09 | Word | 6 | 09-26-2014 05:15 PM |
![]() |
subodhgupta | Word | 4 | 05-22-2014 03:34 AM |
![]() |
vikrantkale | Word | 1 | 03-28-2011 06:13 PM |