Create Word Doc from Access Report, not rtf
Posted on 2008-06-13
I wish to export a report to a Word doc. I know the formatting won't export, thats fine.
Here's my code:
stCriteria = "Tran_ID = " & lTranID
stReport = "rptFleet_Deletion"
stPath = "c:\Fleet_Deletion.Doc"
DoCmd.OpenReport stReport, acViewPreview, , stCriteria, acHidden
DoCmd.OutputTo acOutputReport, stReport, acFormatRTF, stPath, True
DoCmd.Close acReport, stReport
I'm cheating to an extent, in that I'm actually creating an rtf file, but calling it .Doc
Seems to work ok on my PC, but I'd like to be sure before I distribute.
Will this cause problems on any PCs? That is, I don't want users to get a warning about the format being rtf or somesuch.