ftkg
ftkg

Reputation: 1762

How do I export a .doc and some worksheets to one PDF

I need to export a word document, together with some worksheets, via VBA to one PDF file.

I know I can export several worksheets to PDF (each worksheet is a page), but is it possible to include a .doc along with the worksheets?

Upvotes: 0

Views: 154

Answers (1)

d-stroyer
d-stroyer

Reputation: 2706

I would suggest you build a temporary word document programmatically. The macro would be

  1. Create new word document
  2. Open the .doc
  3. Copy its contents into your document
  4. Instanciate Excel
  5. Open each of the .xls
  6. Copy their contents into your document
  7. Save your document as pdf
  8. Close open stuff

Digging out "how-to" for each of the operations should be simple. Post your code when you have it, and we'll help debugging !

NB : Alternatively there are tools to merge pdf files (Search on StackOverflow). You could generate separate pdfs and then merge them. vbscript would be a suitable tool to program that !

Upvotes: 1

Related Questions