Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 04-12-2020, 06:06 AM
gmaxey gmaxey is offline How to loop once through document Windows 10 How to loop once through document Office 2016
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

You could also use a range variable:

Code:
Sub Invited()
Dim oRng As Range
  Set oRng = ActiveDocument.Range
  With oRng.Find
    .Text = "invited"
    .Wrap = wdFindStop
    While .Execute
      oRng.Select
      Selection.HomeKey Unit:=wdLine
      Selection.Characters.First = ChrW(55357) & ChrW(56395)
      oRng.Collapse wdCollapseEnd
    Wend
  End With
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 

Tags
loop macro

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
vba for next loop phoenixmoto Word VBA 4 11-06-2018 01:59 PM
How to loop once through document Loop thru document and create bookmarks jeffreybrown Word VBA 3 09-22-2018 06:04 AM
Loop true all opned word document elbartje Word VBA 1 06-12-2017 05:27 PM
VB for Word - Need macro to loop each line in a document NDeane Word VBA 5 12-22-2015 08:12 PM
How to loop once through document Loop through files and Copy Table Row and Paste into Different Document spiderman1369 Word VBA 2 10-15-2014 08:30 AM

Other Forums: Access Forums

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