Emailing a SNAPSHOT file via SENDOBJECT

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to use the VBA SendObject command to send an email containing an SNP
file (report). The options for that command do not show how I can specify the
SNP format. Access 2002.

How can I do that please?

Thanks!
 
This was the answer:

Sub SendReportAsSNP(PW As String, subj As String, text As String)
Dim appOutlook As New Outlook.Application
Dim itm As Outlook.MailItem
Dim strEMailRecipient As String
Dim strSnapshotFile As String

strSnapshotFile = <filepath and name>

'DoCmd.OutputTo ObjectType:=acOutputReport, _
objectname:=strReport, _
outputformat:=acFormatSNP, _
outputfile:=strSnapshotFile

'Create new mail message and attach snapshot file to it

Set itm = appOutlook.CreateItem(olMailItem)

With itm
.To = strEMailRecipient
.subject = subj
.Body = text
.Attachments.Add strSnapshotFile
.Send
End With
End Sub
 
Back
Top