Sending a report or form by e-mail

ptaylor-west

Registered User.
Local time
Today, 15:20
Joined
Aug 4, 2000
Messages
193
I have an input form which creates a quotation and normally I just print it off, I now want to be able to e-mail it, bearing in mind only the current record needs to be sent. I have tried expoorting it as a text, excel & RTF file but it comes out as columnar and nothing like what the form looks like. The only solution I have come up with is to print it to a PDF Writer which works fine, but is there an easier way as this is complicated for an operator to do - a command button would be ideal. Also my next problem is a simple way of accessing the e-mail address from the access database so that I can send the form - can this be automated, because at the moment I go into Outlook and raise a new message and send a file as an attachment, which is very antiquated I really need to be able to send any form or report direct from within the database as you can within a Word or Excel document.
 
In the database windo click on the "Report" tab. Find the report you want to send and open it in preview. Click "File" on the command menu and choose "Print". In the Printers box choose "Microsoft Fax". This should work if you're running Windows 95 or 98 2nd. If you're using Windows NT 4.0 you might be out of luck.
 
Thanks but it doesn't solve the problem, because it would send the complete report which is about 500 pages not just the selected sheet and I need to send it by e-mail not fax, the other thing is that it needs to be done by pressing a command button as most operators would get confused with selecting print - fax etc etc
 
On the OnClick Event of a button on your form put .......

Dim stDocName As String
stDocName = "MyReportName"
DoCmd.OpenReport stDocName, acViewPreview, ,"[MyID]=Forms![MyFormName]![MyID]
DoCmd.SendObject acSendReport, stDocName, acFormatRTF, [EMailField], , , "My Subject", "My e-mail msg", False, False
DoCmd.Close acReport, stDocName
MsgBox "E-Mail has bee sent"
End Sub

Change stDocName, [MyID], [MyFormName], [EMailField],"My Subject", "My e-mail msg" to your own names and values.
The [EMailField] and [MyID] field must be on your form.

HTH

Kevin M
 
This solution should be ideal, it will be a few days before I can get to try it out though, thanks for your help
 

Users who are viewing this thread

Back
Top Bottom