Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / January 2006

Tip: Looking for answers? Try searching our database.

Automating Report exports

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alan - 19 Jan 2006 04:23 GMT
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
Allen Browne - 19 Jan 2006 04:37 GMT
Try SendObject.
Something like this:

DoCmd.SendObject acSendReport, "Report1", acFormatRTF, _
   "Alan@discussions.microsoft.com",,, "Your report", "Here 'tis", True

If you did need to save the report first, TransferText is another option.

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> Hi Everyone,
>
[quoted text clipped - 31 lines]
>
> Alan
Alan - 19 Jan 2006 06:18 GMT
Hi Allen,

Thanks a lot.  This has solved my problem nicely!

Regards,

Alan

P.S.  I guess with a name like that you had to be one of the good guys  :-)

> Try SendObject.
> Something like this:
[quoted text clipped - 39 lines]
> >
> > Alan
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.