mrigank
asked on
Replace a string in a word file
Hi all,
I have word document. I have a particular string in that document. I want to replace that string with another given string using Visual Basic. My original file has some tables and some images which should be modified. I only have to replace a string with another one.
Can you help me out.
If you can provide the source code, it would really help.
It is urgent.
thanks
mrigank
I have word document. I have a particular string in that document. I want to replace that string with another given string using Visual Basic. My original file has some tables and some images which should be modified. I only have to replace a string with another one.
Can you help me out.
If you can provide the source code, it would really help.
It is urgent.
thanks
mrigank
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Oops, one more mistake found (Silly of me). The code should be 'WApp.Documents.Close True' after the else part of the If statement. Not 'True'.
Dear mrigank, does the code work or needs any change?
WApp.Quit
But it won't make much difference if you don't include it. You just have to manually close word :).