Access and Word

M

martijn

Hello,

I am trying to search a string in a word file from access.
Does anybody know, how to do this?

Regards,

Martijn
 
I

Ivar Svendsen

Hello.

To do this you need to use Automation to open Word, and
then use the VBA commends for the Document object.

An example:

Dim Doc As Word.Document

Set Doc = GetObject("MyWordFile.doc")

With Doc.Range.Find
.ClearFormatting()
.Text = "Search String"
if .Execute then
else
end if
End Width
 
T

TC

Hi Ivar

Can you really use GetObject like that? I thought it needed a progid like
"Word.Application".

TIA,
TC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top