|
-
Jun 10th, 2007, 10:11 AM
#1
Thread Starter
New Member
Find&Replace in Word!
Hi,
if have a problem. I tried to create macro in word, which find should words in the text, by scanning a a excel sheet( only one column).
If there is match, it should be replaced by a Word/Value of the same excelsheet just another column, but same row.
It would be great, if someone can help me.
The excelsheet looks like:
1. Column 2. Column
Contact.N Contact.M
Best Regards & Thanks for any response.
Frantic
-
Jun 11th, 2007, 08:48 AM
#2
Re: Find&Replace in Word!
Open the excel sheet (in and excel object, visibility false).
Find the bottom most data line.
Start a loop from the top to that number.
grab the 'find' and 'replace with' from the spreadsheet into a variable each
Code:
activedocument.range = replace(activedocument.range,strFind,strReplaceWith)
Keep looping until complete.
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|