Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using VBA to convert an HTML file into PDF

Status
Not open for further replies.

jumpjack

Programmer
Jul 28, 2006
79
IT
I wrote a macro which downloads some web pages to my HD; now I want to convert each of these pages into a PDF file, and finally to concatenate all PDFs into a single one.
Is this accomplishable in VBA? I only find code snippets to save Excel/Access/Word files into PDF!


-- Jumpjack --
 
Well, it could be as simple as printing to a PDF.

But as for concatonating them, how are you saving the files? as HTML files, text files, or what? If as HTML, then I'm not sure right off hand that VBA will be the best tool for concatonating, though I'd be shocked if it's impossible.

So.... since Word can handle html files, you could try:
1. Open files in word
2. Print to PDF (If you don't have Adobe Acrobat, you can install soemthing like CutePDF to print to PDF for free. Well, Office 2007/2010 may handle this natively as well, I do not recall. I know that Adobe tried to sue Microsoft a few years ago over Microsoft building something of that nature directly into Office apps without requiring a separate product such as Acrobat. (I don't remember any details on that, just remember reading a mention or two online)

"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57
 
>Office 2007/2010 may handle this natively as well

Yes - well, sort of

>Adobe tried to sue Microsoft a few years ago

Back in mid-2006, yes. Given that PDF was supposed to be an open standard, this all seemed a bit odd at the time. They also threatened to sue them shortly afterwards over XPS format.

Microsoft thus pulled PDF and XPS exporting into a seperately downloadable addin for Office 2007. SP2 then added it back in natively. Office 2010 has it native from the get go.
 
Thanks for the clarifications, strongm. I couldn't remember the details.

"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top