We help IT Professionals succeed at work.

Exporting Access 2007 Report to Word

newbie46
newbie46 used Ask the Experts™
on
I am using the following stmt to export an Access report to Word. Whether I use acFormatRTF or acFormatHTML, I get the same error 'Microsoft Office Access can't save the output data to the file you've selected'

DoCmd.OutputTo acOutputReport, "rptTemplateFinal", acFormatRTF, _
  "C:\Final Letter.rtf", True

The report that I am exporting has many controls which grow/shrink and the export needs to be editable. I have read in others posts that it may be best to export to HTML to avoid having text truncated?

What is the problem with the above stmt?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012

Commented:
I could not replicate this issue.

Did you do a "Full" install of MS Office.
Sometimes all of these "Filters" will only be installed if you do a "Full" install.

Also, it may be that the Layout/Design of this report is affecting this.
Can you post a screenshot of the report in Print Preview and in Design view?

Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012

Commented:
See here as well:
http://support.microsoft.com/kb/226526

...and make sure you have permissions to create files on root of your C: drive
Can't see anything wrong with the statement.

I don't know if it's a bug or not, but when you change it to a Directory, it will work.

DoCmd.OutputTo acOutputReport, "rptTemplateFinal", acFormatRTF, _
  "C:\YouDirectoryName\Final Letter.rtf", True

HTH,
Daniel
I have the same error, by testing it, btw.
I have the same error, by testing it, btw.

Author

Commented:
danishani,
I can save to C: when creating a PDF. I just get the error with RTF or HTML. Also, since multiple users will use the database, I cannot use my directory name. Could I use %user% in the pathname?

Author

Commented:
boaq2000,
MS Office was installed by my company, so I am not sure of the type of install that was done.
Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012
Commented:
...and dump the line continuation character, and the Autostart Argument, ...temporarily

DoCmd.OutputTo acOutputReport, "rptTemplateFinal", acFormatRTF, C:\YouDirectoryName\Final Letter.rtf"


<MS Office was installed by my company, so I am not sure of the type of install that was done.>
I know this was a factor in previous versions.
I only do full installs, but many companies may opt for a "Typical" install, ...that may not include all output options...

JeffCoachman