PDA

View Full Version : Find Replace in a Word Doc



Emoncada
09-09-2008, 05:59 AM
I have a word document that is a template of code.

I need to manually always go in and change certain numbers to match the equipment i am going to use it for. Is there a way for me to have it auto change pulling the data from a .pdf or excel file.

example.
Excel file
Column A.........Column B..........
site_id.............tr184r1............
SITE_ID...........TR184R1..........
IP Address........192.168.0.2.....
etc....

Basically have it look at column A and replace those matches with column B.
All needed changes are in RED Font that might help.

Can this be done?

RonMcK
09-09-2008, 06:40 AM
Was there supposed to be a file attachment with this? If so, please edit your original post ('manage file attachments') to add the file.

Thanks,

Emoncada
09-09-2008, 10:31 AM
Here is an example of the document that needs to be auto filled. Everything in red.

RonMcK
09-09-2008, 10:46 AM
Since what you want to do is a Mail Merge, I suggest that you use the instructions in MS Word Help to do a data merge using your Excel worksheet as the data source for your forms. Unless I'm missing something, you don't need to use VBA to get this done.

Cheers!

Kenneth Hobs
09-09-2008, 11:56 AM
As Ron said, a standard mailmerge in MSWord should get you there.

If you want to fill a DOC from an open XLS, the VBA code in this link shows how. http://www.mrexcel.com/forum/showthread.php?t=333200