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!

Exporting Reports to a Word Document

Status
Not open for further replies.

bhujanga

Programmer
Oct 18, 2007
181
US
I need to export reports to a Word Documents so people can have a separate editable document file of contract conditions that are sent out. I am doing this by using this command:

DoCmd.OutputTo acReport, stDocName, _
acFormatRTF, Path & "\TCReports\" & Me![PermitNumber] & ".rtf", True
It works, but it hoses the format a little. It puts a random amount of extra space between paragraphs (which are detail sections). This causes the report page breaks to not align with the Word page breaks, which results in one or two orphan lines on headerless pages between the pages with headers. If I print pdfs directly from the report, it works perfectly, so it's definately some kind of bug in the RTF translater. Does anyone know how to avoid this, or have a better way to do it?
Thanks.
 
Reports to Word are problematical. It is possible to output HTML, which can be better, especially if you build the HTML yourself.
 
The only way to create the Word document exactly as you want would be to use automation to start a Word.Application object, and build the document line by line.

Needless to say, this would be a lot of coding.

 
JoeAtWork
I find that <P Class = "abc"> will relate to a Style 'abc', which means that you can do a great deal with HTML.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top