2002-11-06, 19:08 #1
- Join Date
- Dec 2001
- Thanked 0 Times in 0 Posts
Publishing a report as a Word document (A2K)
It is easy to run a preview of a report and manually publish it as a Word document. How can I, using VBA, run a report and have it automatically published as a Word document without manual intervention?
Subscribe to our Windows Secrets Newsletter - It's Free!
Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!
+ Get this BONUS — free!
Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!
2002-11-06, 22:28 #2
- Join Date
- Jun 2002
- Mt Macedon, Victoria, Australia
- Thanked 45 Times in 44 Posts
Re: Publishing a report as a Word document (A2K)
Docmd.outputTo will do it.
The following is copied from Help and modified slightly:
The following example outputs the Employees report in rich-text format (.rtf) to the Employee.rtf file and immediately opens the file in Microsoft Word for Windows:
DoCmd.OutputTo acOutputReport, "Employees", acFormatRTF, "Employee.rtf", TrueRegards