How to print Worddocuments with Excel VBA

A

Aalt

I often have to print a lot of word documents. I know how to print a lot of
Excel documents with a VBA macro. But how can I give in the filenames in a
Excel sheet and print the documents with Word.

So the complete action would be:
- give the variables in Excel
- open the documents in Word
- print the document
- close the document without saving
- open the next document

Can please somebody help me with this problem.
 
T

Tushar Mehta

In Word, record a macro to open a file, print it, and close it.

Write code to call Word from XL (see
http://search.microsoft.com/search/results.aspx?View=msdn&p=1&s=1&c=4
&st=a&qu=automate+office+application&na=30)

Take the code of para 1 and nest it within a loop to go through all the
files in whatever range of the XL worksheet contains your file names.

Qualify all references to the Word objects/properties/methods/commands
with the objWord object variable used to automate Word from XL in para
2. Substitute the hard coded file open with the value frompara 3.

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 

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