Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 02-10-2016, 02:47 PM
macropod's Avatar
macropod macropod is offline Having problems with a Wildcard search Windows 7 64bit Having problems with a Wildcard search Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim i As Long, Rng As Range
With ActiveDocument
  For i = 1 To .ComputeStatistics(wdStatisticPages)
    Set Rng = .GoTo(What:=wdGoToPage, Which:=wdGoToAbsolute, Name:=i)
    Set Rng = Rng.GoTo(What:=wdGoToBookmark, Name:="\Page")
    With Rng
      With .Find
        .ClearFormatting
        .Replacement.ClearFormatting
        .Text = "<BRANDŽ[!\(]{1,5}\([!\)]@\)"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindStop
        .Format = False
        .MatchWildcards = True
        .Execute
      End With
      If .Find.Found Then
        .Text = Trim(Split(.Text, "(")(0))
      End If
    End With
  Next
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue with wildcard search mysterytramp Word 0 05-13-2015 10:40 AM
Where is the error in my wildcard search? Ulodesk Word 10 06-30-2014 01:46 PM
Having problems with a Wildcard search Wildcard search fails in table NobodysPerfect Word VBA 4 06-11-2014 11:02 AM
Having problems with a Wildcard search Tricky wildcard search NobodysPerfect Word 10 03-19-2014 04:29 AM
Wildcard search help. Kempston Word 0 11-13-2009 03:58 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:33 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft