Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 06-10-2014, 02:22 PM
gmaxey gmaxey is offline Macro to Search for all words with (R) and place in new document Windows 7 32bit Macro to Search for all words with (R) and place in new document Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,636
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Code:
Sub FindTrademarks()
Dim oDoc_Source As Document
Dim oDoc_Target As Document
 Dim oRange As Range
Dim n As Long
Dim strAllFound As String
  Application.ScreenUpdating = False
  Set oDoc_Source = ActiveDocument
  Set oDoc_Target = Documents.Add
  With oDoc_Source
    Set oRange = .Range
    With oRange.Find
      .Text = Chr(174)
      While .Execute
        oRange.MoveStart wdWord, -1
        oDoc_Target.Range.InsertAfter oRange & vbCr
        
        oRange.Collapse wdCollapseEnd
      Wend
    End With
  End With
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 

Tags
find & replace, macro, trademark



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to search for 2 words at the same time mrayncrental Word VBA 1 06-08-2014 03:08 AM
How to Turn Off Message "Search from the beginning of a document" in a Macro sleake Word 10 10-15-2013 03:43 PM
Multiple words, one search return2300 Word VBA 0 08-30-2013 12:26 PM
Macro to Search for all words with (R) and place in new document Macro to replace few words in the document ubns Word VBA 7 08-16-2012 10:33 PM
i want to place labels on to the left of the page anchored to words within soooty Word 0 07-07-2010 09:18 AM

Other Forums: Access Forums

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