Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 07-05-2014, 06:24 PM
gmaxey gmaxey is offline Why is this Find string not working Windows 7 32bit Why is this Find string not working Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

It doesn't error here, but then I don't have all of your code and putting strAcronym in the find what field seems like nonsense to me.

Try:

Code:
Sub ScratchMacrop()
Dim oCol As New Collection
Dim lngIndex As Long
'A basic Word macro coded by Greg Maxey
Dim oRng As Word.Range
  lngIndex = 0
  Set oRng = ActiveDocument.Range
  With oRng.Find
    .Text = "<[A-Z]{3,4}>"
    .MatchWildcards = True
    While .Execute
      On Error Resume Next
      oCol.Add oRng.Text, oRng.Text
      On Error GoTo 0
      oRng.Collapse wdCollapseEnd
    Wend
  End With
  For lngIndex = 1 To oCol.Count
    MsgBox oCol(lngIndex)
  Next lngIndex
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why is this Find string not working Find and Replace is not working Brigitte Word 7 06-15-2021 05:10 PM
Why is this Find string not working Way to search for a string in text file, pull out everything until another string? omahadivision Excel Programming 12 11-23-2013 12:10 PM
Why is this Find string not working string concat stopped working? AlexanderJohnWilley Excel 6 09-27-2013 08:39 PM
Why is this Find string not working Find and replace a string of text errtu Word 1 01-31-2013 02:09 PM
Why is this Find string not working Bad view when using Find and Find & Replace - Word places found string on top line paulkaye Word 4 12-06-2011 11:05 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:05 AM.


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