Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-18-2013, 07:31 PM
macropod's Avatar
macropod macropod is offline Mass replacing word(s) Windows 7 64bit Mass replacing word(s) Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hir Gerry,


Quote:
Originally Posted by fumei View Post
If it is a simple replace over a number of files, using DIR would be the simplest way to go.
I'm sure you realize it's a little more complicated than that ... I suspect Greg's Addin uses the Dir command for the batch processing option.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 02-19-2013, 01:55 AM
fumei fumei is offline Mass replacing word(s) Windows 7 64bit Mass replacing word(s) Office XP
Expert
 
Join Date: Jan 2013
Posts: 440
fumei is on a distinguished road
Default

Hi Paul. I am sure Greg's addin does use DIR. It is a very useful tool.

My point was that if it is a simple (say a single word or phrase) operation, then it actually is NOT all that complicated.
Code:
Sub ChangeSomething()
Dim file
Dim path As String
Dim r As Range
path = "c:\ThisOne\"
file = Dir(path & "*.doc")
Do While file <> ""
   Documents.Open path & file
   Set r = ActiveDocument.Range
   r.Find.Execute FindText:="this phrase", _
      ReplaceWith:="booga booga whatever", Replace:=wdReplaceAll
   ActiveDocument.Save
   ActiveDocument.Close
   file = Dir()
Loop
End Sub
All Word docs in the ThisOne folder get the phrase changed. Yes, for sure, the addin is handy, and it works. However, again, if it is a simple operation, then performing that action on all files in a folder is also simple.

The OP asked: "is there any way to replace some text in multiple files at one time with a new text"

The answer of course is, yes.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mass editing of hyperlinks Michael137 PowerPoint 0 10-29-2012 02:44 AM
Mass replacing word(s) Prevent OOO reply when sending a mass email tdmag62 Outlook 1 11-30-2011 09:27 PM
Mass replacing word(s) Word replacing problem!!!! Jamal NUMAN Word 2 07-08-2011 03:56 AM
Mass replacing word(s) Mass e-mail seperation daryl Mail Merge 1 03-23-2010 03:45 PM
Mass replacing word(s) Mass attachment downloads? dpool2002 Outlook 1 06-21-2006 02:11 PM

Other Forums: Access Forums

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