By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,140 Members | 1,301 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,140 IT Pros & Developers. It's quick & easy.

Access Report exporting and merging to Word/PDF

P: 7
I try to Export and Merging Access Reports, some in table-format = with lines, and some with graphics. But I only can generate text documents.

What do I have to do to export these reports to Word in the right format?
And if I merged the generated document. Is it possible to save this document in the right format as a PDF-document?

I found some code like this: wordApp.ActiveDocument.SaveAs strOutputFileName, wdFormatPDF, ...

Thank you Wesley
Jul 2 '12 #1
Share this Question
Share on Google+
6 Replies


P: 4
look at the docmd.OutputTo command. More specifically, the OutputFormat parameter of the command. That will let you save the report in:
acFormatASP
acFormatDAP
acFormatHTML
acFormatIIS
acFormatRTF
acFormatSNP
acFormatTXT
acFormatXLS
acFormatXLSX
acFormatXLSB
acFormatXPS

But I know PDF is available. I have an app using:

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OutputTo acOutputReport, pReport, acFormatPDF, TempVars!reportfilename, pPreview
Jul 13 '12 #2

zmbd
Expert Mod 5K+
P: 5,397
WesleyN

Which version of Access are you using?

MarkP2012 will certainly work... if you're using MS office 2010... we skipped 2007 due to a lot of user complaints about the ribbon and missing features like exporting to Excel; thus, I don't know if the pdf format is available directly from MSAccess 2007 - but I do remember reading that you had to download an add-in or it was available after one of the service packs so I am fairly certain that is not a basic option in 2007 (*).

In both 2007 and 2010 there have been some major gripes about the inability to take the reports designed in Access directly to either Word or Excel while maintaining the formating... IMHO, frankly a major mistake on MS. In 2010 there is an option to take the report to a PDF document and, for me, it has held the formatting nicely. There are however automation commands and other workarounds for getting a report to a word document.

(*) There are also free or shareware type pdf printer drivers that you can install on the PC that will handle this too.


-z
Jul 14 '12 #3

P: 7
I've solved this with two external components. I'm using now PDFSharp (open source) and PDFFocus (shareware) via a small .NET tool.

MS Access doesn't work good enough with Excel and Word.

You can adding references with Word and Excel. But you have to make templates for the borders. And I had too few time for doing that.

I know the function OutputTo. But you can only export text to Word and Excel. And for PDF, you can only export single Reports. A snapshot (SNPFormat) makes a picture of your report.
Jul 17 '12 #4

zmbd
Expert Mod 5K+
P: 5,397
Sounds like you were/are using 2007.
Jul 17 '12 #5

P: 7
That's correct. But I can't change this solution.
Jul 19 '12 #6

zmbd
Expert Mod 5K+
P: 5,397
I know that you have a solution with the pdf printer; however, I've found some information about automating word from within Access... Honestly, I haven't done this as we went directly to 2010 which allows direct pdf creation of the reports; however, although written for 2000, the following might be useful: http://www.databaseadvisors.com/news...mationlpt1.asp
http://www.databaseadvisors.com/news...omationpt2.asp
-z

[edit] here's one using an exsiting document: http://www.applecore99.com/gen/gen033.asp
Jul 19 '12 #7

Post your reply

Sign in to post your reply or Sign up for a free account.