manipulating a Word document from Access

Is there a way to do a find and replace in Access to alter the data stored in a Word doc?

I also want to include a procedure in Access that would locate a string in a Word doc and then select the whole row to delete it.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

First, use word to record a macro that does what you want to do.  Then go to Tools|Macros|Visual Basic Editor  to have a look at the macro that was made.  There you will find the WordBasic commands and arguments that accomplish what it is that you want to do.

Create a word object,

  Dim wd as Object
  Set wd = CreateObject("Word.Basic")

now you can use that object to run the commands that you found in the Word Visual Basic Editor.

  wd.Documents.Open FileName:="abc123.doc"
  With wd.Selection.Find
    .Text = "<Text To Find>"
    .Replacement.Text = "Yada Yada"
    .Execute Replace:=wdReplaceAll, _
             Forward:=True, _
End With



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jptuAuthor Commented:
This is great.  Thanks Brian.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.