Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 01-06-2024, 02:41 AM
gmaxey gmaxey is offline Batch editing text in text box of multiple word documents Windows 10 Batch editing text in text box of multiple word documents Office 2019
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 have to target the right storyrange:


Code:
Sub ScratchMacro()
'A basic Word Macro coded by Gregory K. Maxey
Dim oRng As Range
  Set oRng = ActiveDocument.StoryRanges(wdTextFrameStory)
  Do
    With oRng.Find
      .Text = "Test"
      While .Execute
        oRng.Select
      Wend
    End With
    Set oRng = oRng.NextStoryRange
  Loop Until oRng Is Nothing
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch change headers en footers in multiple documents Kipvis Word VBA 1 04-14-2023 07:55 AM
Batch Editing Word documents sakhtar6 Word VBA 6 03-02-2020 02:49 PM
Batch editing text in text box of multiple word documents Finding specific text in IF-fields across multiple Word documents Office_Worker Word VBA 7 10-19-2017 03:50 AM
batch extract all tables in multiple word documents ZaidaBa Word Tables 3 05-08-2017 10:22 PM
Batch editing text in text box of multiple word documents Inputing Text from Excel sheet to multiple Word documents and Visio File Jazz43 Office 1 05-30-2013 02:08 PM

Other Forums: Access Forums

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