VBA in Microsoft Word

gdspeare

Board Regular
Joined
Oct 8, 2002
Messages
198
Does anyone have any code that will open all the files in a specified folder and then replace every instance of a certain word, resave and then move to the next file?

Thanks,

David
 
I agree w/ you. I tried running the new code, but it does not open the file on my computer. So I think it has something to do w/ locating the file.

FYI:
I have the file in C:\My Documents.
It is closed.

I will change the path in the macro to look on my desktop and then put the file there.

I will let you know the outcome.

Doug
 
Upvote 0

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Purnima,
I found the problem. It is in the path.

This is the correct path for my computer:
C:\Documents and Settings\Doug\My Documents
 
Upvote 0
I would like to ask you a follow up question. Now that I see how this operates, is it possible to perform the delete/insert in one step? Or, is it a requirement to step through each item one by one to make the change?

Thanks,

Doug
 
Upvote 0
Oh!! So that was the problem. Good to know it's solved now.

About your follow up question, what you mean is, is it possible to find multiple terms and replace them at the same time? Yes. I think that should be possible. Do you want to replace each term with a different term or do you want to find multiple terms and replace them with a single term all at the same time?

Do let me know and i'll try to modify the code accordingly.

Purnima.
 
Upvote 0
Purnima,
Thanks for the follow up. Sorry, I never received your last post. I just happened to log back on and saw there was new post in this thread.

Sure, if we could set up the macro to find & replace in all one step, that would be a great option. I think having it as an option rather than taking away the other method of stepping through item by item would be the best of all solutions.


Cheers,

Doug
 
Upvote 0

Forum statistics

Threads
1,224,884
Messages
6,181,569
Members
453,054
Latest member
arz007

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top