Access and Word

  • Thread starter Thread starter martijn
  • Start date Start date
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
 
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
 
Hi Ivar

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

TIA,
TC
 
Back
Top