Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 02-13-2019, 03:55 PM
Guessed's Avatar
Guessed Guessed is offline How to return the full string (entire word) when searching with wildcards in word vba Windows 10 How to return the full string (entire word) when searching with wildcards in word vba Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Try
Code:
Sub FindWords2()
  Dim aRng As Range, sResponse As String
  sResponse = "<32P[0-9]{1,}"
  Set aRng = ActiveDocument.Range
  If sResponse <> "" Then
    With aRng.Find
      .ClearFormatting
      .Text = sResponse
      .MatchWildcards = True
      Do While .Execute  ' Loop until Word can no longer find the search string
        MsgBox aRng.Text
      Loop
    End With
    Application.ScreenUpdating = True
  End If
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 

Tags
wildcard searches



Similar Threads
Thread Thread Starter Forum Replies Last Post
Check if a string is part of an array (containing wildcards...) jodecaesteker Excel Programming 3 02-02-2018 10:56 AM
How to return the full string (entire word) when searching with wildcards in word vba Wildcards: searching for multiple words / expressions close to each other ballpoint Word VBA 7 11-09-2017 03:30 PM
Searching for string on a formula AMD2800 Excel 1 12-17-2014 10:41 AM
How to return the full string (entire word) when searching with wildcards in word vba Return entire program to default blockie Word 2 04-13-2013 07:18 PM
Return Entire Row ibrahimaa Excel 3 01-10-2012 05:44 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:42 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