p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Pro VB Databases (http://p2p.wrox.com/forumdisplay.php?f=81)
-   -   Automating report output (http://p2p.wrox.com/showthread.php?t=37379)

alantodd January 18th, 2006 10:43 PM

Automating report output
 
Hi Everyone,

I have a report in my MS Access application that I would like to attach to an e'mail and send to others.

To do this manually, I preview the report, right click and select Export. Then save as an RTF file and attach to an e'mail. I need to automate this so it occurs with a single button click.

In effect the module will need to export the report to an RTF file, then call the routine that sends the e'mail. The problem I am having is that I am trying to use the following commands to output the report:

DoCmd.SelectObject ReportName, True
DoCmd.RunCommand acCmdOutputToRTF

When I run this, it does two things taht I don't want it to do.

Firstly it displays the Database Window which I want to keep hidden from the users

Secondly, Once it has created the .rtf file, it automatically launches MS Word and displays the results.

I need to find out how to stop the Database window opening and how to stop MS Word from launching.

Any help or hints would be most appreciated.

TIA,

Alan


Baloo April 4th, 2006 08:24 AM

hi Alan,

maybe it's too late, but:)
Code:

DoCmd.OutputTo acReport, "repCustomers", acFormatRTF, "C:\Test.doc", True/False
True/False - it's for Word-Start: to be or not to be:)

kind regards,
Baloo.



All times are GMT -4. The time now is 08:58 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.