trying to search 4 text in a word doc & print page?

R

rede96

I am using VBA to open a word document from Excel, which is no problem
(Using the CreateObject method, Dim wrdApp As Word.Application, Di
wrdDoc As Word.Document etc.)

I would then like to search for a given string in the word document an
then print the current page.

Also, (But it's not that important.) I would then like to close th
word doc and rename it so I know the file has been processed.

Can anyone help me with the VBA code I should use to do this please?

TIA

Re
 
G

Guest

Open a document in Word, switch the macro recorder on and then search for something, File | Print + select current selection and then switch off macro recorder

The bulk of the code is now available in the VBE (Alt + F11). To make the code work from within Excel, prefix the Word objects with the name of the object that you are using (withing Excel) as an instance of Word.
 

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