Emailing a SNAPSHOT file via SENDOBJECT

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!
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top