Access 2007 Runtime: acCmdOutputToRTF not working

  • Thread starter Thread starter Mario Reinhöfer
  • Start date Start date
M

Mario Reinhöfer

Hi there,

i have code that opens a report and then transfer it to Word:

' Output to Word as RTF
DoCmd.RunCommand acCmdOutputToRTF

Does work in Access 2007, but not in the Access 2007 Runtime.

I already added an "ExportWord" button to the QAT (so that the User can do
the export via button"). Everything works fine in the Runtim, but when
pressing the button the Export Wizard appears and then comes an error
message (syntax error or function not possible).

Any ideas for a workaround for this?

Thanks in advance!
Mario
 
Mario -

Take a look at this thread on the Utter Access site. You'll find this
little gem about 2/3 of the way down. Based on the comments, this seems to
do the trick.

http://www.utteraccess.com/forums/printthread.php?Cat=&Board=85&main=1476141&type=thread

Re: OutputTo and the Runtime Version
I have found that the runtime is looking for Utility.accda which is in the
\Accwiz folder and which the runtime doesn't know about. If you copy
Utility.accda from the \Accwiz folder into the main runtime folder (where
msaccess.exe is), the exports should work.


You might also look at the utility to export reports as PDF's. It's free
from Microsoft and works with the Runtime. You might have to hunt around a
bit to get details on what the actual licensing terms of the utility are.
I've installed it on machines that do not have Access (just the RT), but do
have older versions of Office Small Business (2003, 2000), and as I just
mentioned, I've had no problems using it. I couldn't say whether it would
work on a machine that had no Office version installed.

http://www.microsoft.com/downloads/...3C-6D89-4F15-991B-63B07BA5F2E5&displaylang=en
 
Scott,
I have found that the runtime is looking for Utility.accda which is in the
\Accwiz folder and which the runtime doesn't know about. If you copy
Utility.accda from the \Accwiz folder into the main runtime folder (where
msaccess.exe is), the exports should work.

hmm, that doesn't help, even with the Utility.accda in the folder where
msaccess.exe resides i get the runtime error under Access 2007 runtime.

Mario
 
Hi Mario,

I remember running across your problem a couple of month ago, but I ended up
switching my reports over to PDF (which is far better for my purposes than
RTFs) so I don't remember whether I ever solved the problem. I don't have a
machine with the runtime anywhere near me today, so I can't test anything.

Here's another possibility.


http://www.microsoft.com/downloads/...d9-9dc6-4b38-9fa6-2c745a175aed&displaylang=en

942378 Issues that are fixed in Access 2007 by the 2007 Microsoft Office
suites Service Pack 1

The Access 2007 Runtime updates files to correct some specific Access 2007
runtime issues that were not previously documented in a Microsoft Knowledge
Base article:

PDF/XPS Export: You may see a message similar to "can't save the output
data to the file you've selected" or "The OutputTo action was cancelled",
when you try to export an object to the PDF or XPS file formats from within
Access 2007 Runtime.

Text/HTML Export: You see a message similar to "can't complete the
Output operation" when you try to export a report to the Text or HTML file
formats from within Access 2007 Runtime.
 
Hi Mario,

Some good news and some bad news. The good news is that I was able to use
SendObject to export an RTF file to an email message on a machine that has
only the Runtime installed. This shows that it is possible. The bad news
is that it doesn't give you any clue as to why you can't do it on your
computer.

Reading your original post again, I'm wondering whether the problem is not
the RTF, but the QAT. I've read that Microsoft has really slammed the door
on using the built in interface (navigation pane, ribbon) in the Runtime.
The problem might be that you are trying to fire off an event from QAT,
which is part of the ribbon, and might therefore be disabled. Have you
tried putting a command button on a form, then using it to fire off the
SendObject code? In my application, I had to create my own ribbons
including a custom print preview ribbon for my reports. My ribbon buttons
call macro events, including SendObject. If this turns out to be the issue,
you'll have to cook up some custom ribbons of your own. It's not as bad as
it sounds. I can send you a couple of good links and some code samples.

Here's another possibility - have you tried exporting to other formats such
as text and html? If they don't work, then you know your problem is not
with RTF. Then again, if they do work, and you are able to export other
formats, then we're back to square one.

Regards,
Scott
 
Scott,
Reading your original post again, I'm wondering whether the problem is not
the RTF, but the QAT. I've read that Microsoft has really slammed the
door on using the built in interface (navigation pane, ribbon) in the
Runtime.

interesting idea, in the runtime's ribbon interface for print preview the
"export to Word" button is not there (or disabled, don't know), so it would
make sense to create a new ribbon to give the user a chance to start the
export manually. But in my case i want to start the output by code.

if i replace my output method from:

' Open Report in print preview
DoCmd.OpenReport "Report_to_Word", acViewPreview, "", ""
' Export to Word
DoCmd.RunCommand acCmdOutputToRTF

to:

' Export to Word without print preview
DoCmd.OutputTo acOutputReport, "Report_to_Word", acFormatRTF, , False

i come (in the runtime) at least to the point where a file dialog appears, i
can set the filename, press Ok and the rtf-file IS created. The runtime
error appears after closing the file dialog, but the rtf-file ist created.

Mario
 
Back
Top