dbTalk Databases Forums  

Emailing 2 reports

comp.databases.ms-access comp.databases.ms-access


Discuss Emailing 2 reports in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
dee
 
Posts: n/a

Default Emailing 2 reports - 10-08-2008 , 10:19 AM






I need to send an email containing 2 reports.

I have tried sending a 2 page snapshot report, but while it prints
just fine before sending, email is only receiving 1 page.

Is there a way to do this in VB code?

Can I somehow program the 'Attach:' line in outlook express to include
'Report1' and 'Report2'?
If there is, I would very grateful for a few lines of code.

If this cannot be done, is there another way?

Reply With Quote
  #2  
Old   
ARC
 
Posts: n/a

Default Re: Emailing 2 reports - 10-10-2008 , 08:57 PM






Outlook express uses the MAPI method (simple docmd.sendjobject), which does
not support additional attachments other than the report you are sending.
For additional attachments, you'll need to use full outlook (not express or
windows mail), and the coding changes quite a bit. Look at the sample code
below, and you'll see where you can add additional attachments. Hope this
helps,

(There are a number of Me![FieldName] references below that refer to options
for importance, read receipt, etc. from the form the code is taken from).

Dim objOutlook As Object, sendaddr As String, MainLoopNum As Integer,
MainMail() As String, ExpFile As String, addlattach As String
Dim objOutlookMsg As Object
Dim objOutlookRecip As Object
Dim objOutlookAttach As Object
Set objOutlook = CreateObject("Outlook.Application")
' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
'
addr = Trim$(Me!txtEmail)
With objOutlookMsg
Set objOutlookRecip = .Recipients.Add(addr)
objOutlookRecip.Type = olTo
End With
'
With objOutlookMsg
' Set the Subject, Body, and Importance of the message.
.Subject = Me!txtSubject
'If Me!chkEnableRich = -1 Then
' .HTMLBody = Me!txtBody
'Else
.Body = Me!txtBody
'End If
If Me!cboPriority = 2 Then
.Importance = olImportanceHigh 'High importance
End If
'
'Check for read receipt
If Me!ChkReceipt = -1 Then
.ReadReceiptRequested = True
End If
'ReadReceiptRequested

Set objOutlookAttach = .Attachments.Add(ExpFile)
'additional attachments, repeat below
'Set objOutlookAttach = .Attachments.Add(ExpFile)

'
' Resolve each Recipient's name.
For Each objOutlookRecip In .Recipients
objOutlookRecip.Resolve
'If Not objOutlookRecip.Resolve Then
'objOutlookMsg.Display
'End If
Next
'objOutlook.visible = True
'.Send
.Display
End With
'Set objOutlookMsg = Nothing
Set objOutlook = Nothing
DoCmd.Hourglass 0
DoEvents


Reply With Quote
  #3  
Old   
Earl Anderson
 
Posts: n/a

Default Re: Emailing 2 reports - 10-10-2008 , 09:37 PM



If you are considering "another way" of sending reports, consider a 'pdf'
file converter such as "nova PDF Pro" which installs itself on your machine
as one of your 'printers' on your "Printer List". When you bring up your
report and select File-->Print, and select 'novaPDF Pro as your 'printer',
it puts that report into a 'pdf' file to be 'saved' wherever you like and
then you can send it as an email attachment whenever. The advantage is that
as a 'pdf' file, your recipient does not have to have MS Access installed or
even MS Office as is the case with the 's.np' file format.

Earl


"dee" <promotions.marketing (AT) comcast (DOT) net> wrote

Quote:
I need to send an email containing 2 reports.

I have tried sending a 2 page snapshot report, but while it prints
just fine before sending, email is only receiving 1 page.

Is there a way to do this in VB code?

Can I somehow program the 'Attach:' line in outlook express to include
'Report1' and 'Report2'?
If there is, I would very grateful for a few lines of code.

If this cannot be done, is there another way?



Reply With Quote
  #4  
Old   
Salad
 
Posts: n/a

Default Re: Emailing 2 reports - 10-11-2008 , 09:08 AM



Earl Anderson wrote:
Quote:
If you are considering "another way" of sending reports, consider a 'pdf'
file converter such as "nova PDF Pro" which installs itself on your machine
as one of your 'printers' on your "Printer List". When you bring up your
report and select File-->Print, and select 'novaPDF Pro as your 'printer',
it puts that report into a 'pdf' file to be 'saved' wherever you like and
then you can send it as an email attachment whenever. The advantage is that
as a 'pdf' file, your recipient does not have to have MS Access installed or
even MS Office as is the case with the 's.np' file format.

I used NovaPDF for a while but due to some problems I had with it on
dualcore PCs I switched to Stephen Lebans snapshot to PDF converter and
it works like a champ. I liked NovaPDF because one could specifiy the
folder and filename to save it to.

Quote:
Earl


"dee" <promotions.marketing (AT) comcast (DOT) net> wrote in message
news:e1c00a63-515a-4157-ba46-e14f426cf225 (AT) d10g2000pra (DOT) googlegroups.com...

I need to send an email containing 2 reports.

I have tried sending a 2 page snapshot report, but while it prints
just fine before sending, email is only receiving 1 page.

Is there a way to do this in VB code?

Can I somehow program the 'Attach:' line in outlook express to include
'Report1' and 'Report2'?
If there is, I would very grateful for a few lines of code.

If this cannot be done, is there another way?




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.