I need to open a word Document then find certain text and replace it from
excel.
example:
Open WordDocTest.doc
Find text "<project#>"
Replace text with "Test234"
I can open the document but cannot get it to search.
Any ideas
Thank You!
I need to open a word Document then find certain text and replace it from
excel.
example:
Open WordDocTest.doc
Find text "<project#>"
Replace text with "Test234"
I can open the document but cannot get it to search.
Any ideas
Thank You!
Shawn,
Here is an excellent example of what you want.
http://word.mvps.org/FAQs/InterDev/C...WordFromXL.htm
Steve Yandl
"Shawn G." <ShawnG@discussions.microsoft.com> wrote in message
news:67075407-BB22-46AD-8EDF-3EE38EB55602@microsoft.com...
>I need to open a word Document then find certain text and replace it from
> excel.
> example:
> Open WordDocTest.doc
> Find text "<project#>"
> Replace text with "Test234"
>
> I can open the document but cannot get it to search.
> Any ideas
>
> Thank You!
>
You might be better off setting an object to the Word application, then
setting an object to the document opened. Then you can use the Word
application Find object on the doc object. Set your Excel cell text to a
variable, and use that variable in the Replace. Make sure you set a
reference to the Word library.
Ed
"Shawn G." <ShawnG@discussions.microsoft.com> wrote in message
news:67075407-BB22-46AD-8EDF-3EE38EB55602@microsoft.com...
> I need to open a word Document then find certain text and replace it from
> excel.
> example:
> Open WordDocTest.doc
> Find text "<project#>"
> Replace text with "Test234"
>
> I can open the document but cannot get it to search.
> Any ideas
>
> Thank You!
>
I have the word Doc set as an object, and I can get it open. The problem is
finding the text. I cannot figure out how to get the .FIND to work.
Any ideas?
Thanks,
"Ed" wrote:
> You might be better off setting an object to the Word application, then
> setting an object to the document opened. Then you can use the Word
> application Find object on the doc object. Set your Excel cell text to a
> variable, and use that variable in the Replace. Make sure you set a
> reference to the Word library.
>
> Ed
>
> "Shawn G." <ShawnG@discussions.microsoft.com> wrote in message
> news:67075407-BB22-46AD-8EDF-3EE38EB55602@microsoft.com...
> > I need to open a word Document then find certain text and replace it from
> > excel.
> > example:
> > Open WordDocTest.doc
> > Find text "<project#>"
> > Replace text with "Test234"
> >
> > I can open the document but cannot get it to search.
> > Any ideas
> >
> > Thank You!
> >
>
>
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks