PDA

View Full Version : Changing text with multiple outcomes depending on document



marvin_g14
01-16-2013, 12:24 PM
I'm sure it has been discussed before and I am really sorry to bring it up. At my job I have to edit about 400 documents every month about 2-3 times for each document. So far I've figured out how to replace text with the same texts (ex.dates and times) but I have to change names for every document so far I've just used the find and replace for every document but my job load is getting bigger and bigger.

So point is I am trying to change the documents who all have <names> in it with the person's name whose document belongs to. In one simple click. For example one document i want replaced with Mr. Henriquez another with Mr. Johnson so on and so on. A point towards the right direction would be greatly appreciated. or any help.



Ps. I have the most minimum experience with VBA but am always willing to learn.

Thank you!:banghead:

fumei
01-16-2013, 12:40 PM
Start with a clear accurate description, with an example, of what you want to happen.

As it stands now, Find and Replace sounds like precisely the way to go. No VBA. Except perhaps using VBA to work through multiple documents in a folder(s).

In which case, use the DIR function. However, the DIR function justs works through multiple files. What happens to each file has nothing to do with DIR.

So you could use DIR to work on each file, and use Find and Replace for the operations on each file.

brent.fraser
01-16-2013, 12:42 PM
Hey Marvin,

Welcome aboard.

Here's something I found that might be able to help you out. I haven't tried it but it's something you might want to explore.

http://www.word.mvps.org/FAQs/MacrosVBA/BatchFR.htm

Here's the post where I found the above url:
http://www.wordbanter.com/showthread.php?t=79487

It has a couple of good tips not included in the first url.

Brent

fumei
01-16-2013, 03:36 PM
Two comments regarding the MVPS article.

1. Technically, you do not need the $, as in Dir$. Just Dir will work.

2. Much more importantly; this is an old article. As of 2007, Microsoft in its patronizing wisdom took FileSearch away from us. You can no longer use FileSearch. You no longer have simple direct access to the file system. So the second example can NOT be used for any version past 2003.

gmaxey
01-17-2013, 08:04 AM
The add-in decribed here was made for processing find and replace operations on multiple files:

http://gregmaxey.mvps.org/word_tip_pages/vba_find_and_replace.html