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.

How can I do that please?

Thanks!
 
G

Guest

Automate sending a report snapshot in e-mail
1. Create a macro.
2. Add the SendObject action to the macro. For example:
Argument: Value
Object Type: Report
Object Name: Summary of Sales by Quarter
Output Format: Snapshot Format
To: All Northwind Traders; Shareholders
Cc: none
Bcc: none
Subject: Quarterly Sales report
Message Text: This is our best quarter in years!
Edit Message: No

Run the macro each time you want to send the report snapshot.

Sarah
 
G

Guest

I'm triggering this via VBA. Can I pass the TO, SUBJECT and BODY data to the
macro?
 
G

Guest

The sendobject command can also be used in vba. You would specify Snapshot
Format for the Output Format. You can also use the macro to specify the To,
SUBJECT and BODY data. You would refer to a control in your form which
contains these values.

Example:
[Forms]![frmSend]![To]
[Forms]![frmSend]![Subject]
[Forms]![frmSend]![Body])
 
G

Guest

Ahh, but Snapshot format is NOT one of the allowable Output Formats for that
command in Access 2002. Hence my problem...

Sarah said:
The sendobject command can also be used in vba. You would specify Snapshot
Format for the Output Format. You can also use the macro to specify the To,
SUBJECT and BODY data. You would refer to a control in your form which
contains these values.

Example:
[Forms]![frmSend]![To]
[Forms]![frmSend]![Subject]
[Forms]![frmSend]![Body])

Dennis said:
I'm triggering this via VBA. Can I pass the TO, SUBJECT and BODY data to the
macro?
 
G

Guest

Sorry you didn't specify that you were working in Access 2002. I assumed 2003.

Dennis said:
Ahh, but Snapshot format is NOT one of the allowable Output Formats for that
command in Access 2002. Hence my problem...

Sarah said:
The sendobject command can also be used in vba. You would specify Snapshot
Format for the Output Format. You can also use the macro to specify the To,
SUBJECT and BODY data. You would refer to a control in your form which
contains these values.

Example:
[Forms]![frmSend]![To]
[Forms]![frmSend]![Subject]
[Forms]![frmSend]![Body])

Dennis said:
I'm triggering this via VBA. Can I pass the TO, SUBJECT and BODY data to the
macro?

:

Automate sending a report snapshot in e-mail
1. Create a macro.
2. Add the SendObject action to the macro. For example:
Argument: Value
Object Type: Report
Object Name: Summary of Sales by Quarter
Output Format: Snapshot Format
To: All Northwind Traders; Shareholders
Cc: none
Bcc: none
Subject: Quarterly Sales report
Message Text: This is our best quarter in years!
Edit Message: No

Run the macro each time you want to send the report snapshot.

Sarah

:

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.

How can I do that please?

Thanks!
 
G

Guest

Eventhough it doesn't show it as an option, try it anyways. I was able to
use this feature in Access 2000 specifying the Output format as Snaphot
Format.

Dennis said:
Ahh, but Snapshot format is NOT one of the allowable Output Formats for that
command in Access 2002. Hence my problem...

Sarah said:
The sendobject command can also be used in vba. You would specify Snapshot
Format for the Output Format. You can also use the macro to specify the To,
SUBJECT and BODY data. You would refer to a control in your form which
contains these values.

Example:
[Forms]![frmSend]![To]
[Forms]![frmSend]![Subject]
[Forms]![frmSend]![Body])

Dennis said:
I'm triggering this via VBA. Can I pass the TO, SUBJECT and BODY data to the
macro?

:

Automate sending a report snapshot in e-mail
1. Create a macro.
2. Add the SendObject action to the macro. For example:
Argument: Value
Object Type: Report
Object Name: Summary of Sales by Quarter
Output Format: Snapshot Format
To: All Northwind Traders; Shareholders
Cc: none
Bcc: none
Subject: Quarterly Sales report
Message Text: This is our best quarter in years!
Edit Message: No

Run the macro each time you want to send the report snapshot.

Sarah

:

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.

How can I do that please?

Thanks!
 
G

Guest

What number do I use for that? There's no "acFormatSnapshot" defined in VB.

Sarah said:
Eventhough it doesn't show it as an option, try it anyways. I was able to
use this feature in Access 2000 specifying the Output format as Snaphot
Format.

Dennis said:
Ahh, but Snapshot format is NOT one of the allowable Output Formats for that
command in Access 2002. Hence my problem...

Sarah said:
The sendobject command can also be used in vba. You would specify Snapshot
Format for the Output Format. You can also use the macro to specify the To,
SUBJECT and BODY data. You would refer to a control in your form which
contains these values.

Example:
[Forms]![frmSend]![To]
[Forms]![frmSend]![Subject]
[Forms]![frmSend]![Body])

:

I'm triggering this via VBA. Can I pass the TO, SUBJECT and BODY data to the
macro?

:

Automate sending a report snapshot in e-mail
1. Create a macro.
2. Add the SendObject action to the macro. For example:
Argument: Value
Object Type: Report
Object Name: Summary of Sales by Quarter
Output Format: Snapshot Format
To: All Northwind Traders; Shareholders
Cc: none
Bcc: none
Subject: Quarterly Sales report
Message Text: This is our best quarter in years!
Edit Message: No

Run the macro each time you want to send the report snapshot.

Sarah

:

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.

How can I do that please?

Thanks!
 
G

Guest

Type acFormatSNP and see if that works.

Dennis said:
What number do I use for that? There's no "acFormatSnapshot" defined in VB.

Sarah said:
Eventhough it doesn't show it as an option, try it anyways. I was able to
use this feature in Access 2000 specifying the Output format as Snaphot
Format.

Dennis said:
Ahh, but Snapshot format is NOT one of the allowable Output Formats for that
command in Access 2002. Hence my problem...

:

The sendobject command can also be used in vba. You would specify Snapshot
Format for the Output Format. You can also use the macro to specify the To,
SUBJECT and BODY data. You would refer to a control in your form which
contains these values.

Example:
[Forms]![frmSend]![To]
[Forms]![frmSend]![Subject]
[Forms]![frmSend]![Body])

:

I'm triggering this via VBA. Can I pass the TO, SUBJECT and BODY data to the
macro?

:

Automate sending a report snapshot in e-mail
1. Create a macro.
2. Add the SendObject action to the macro. For example:
Argument: Value
Object Type: Report
Object Name: Summary of Sales by Quarter
Output Format: Snapshot Format
To: All Northwind Traders; Shareholders
Cc: none
Bcc: none
Subject: Quarterly Sales report
Message Text: This is our best quarter in years!
Edit Message: No

Run the macro each time you want to send the report snapshot.

Sarah

:

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.

How can I do that please?

Thanks!
 
G

Guest

Error 2282:

The format in which you are attempting to output the current object is not
available.

Sarah said:
Type acFormatSNP and see if that works.

Dennis said:
What number do I use for that? There's no "acFormatSnapshot" defined in VB.

Sarah said:
Eventhough it doesn't show it as an option, try it anyways. I was able to
use this feature in Access 2000 specifying the Output format as Snaphot
Format.

:

Ahh, but Snapshot format is NOT one of the allowable Output Formats for that
command in Access 2002. Hence my problem...

:

The sendobject command can also be used in vba. You would specify Snapshot
Format for the Output Format. You can also use the macro to specify the To,
SUBJECT and BODY data. You would refer to a control in your form which
contains these values.

Example:
[Forms]![frmSend]![To]
[Forms]![frmSend]![Subject]
[Forms]![frmSend]![Body])

:

I'm triggering this via VBA. Can I pass the TO, SUBJECT and BODY data to the
macro?

:

Automate sending a report snapshot in e-mail
1. Create a macro.
2. Add the SendObject action to the macro. For example:
Argument: Value
Object Type: Report
Object Name: Summary of Sales by Quarter
Output Format: Snapshot Format
To: All Northwind Traders; Shareholders
Cc: none
Bcc: none
Subject: Quarterly Sales report
Message Text: This is our best quarter in years!
Edit Message: No

Run the macro each time you want to send the report snapshot.

Sarah

:

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.

How can I do that please?

Thanks!
 
G

Guest

I CAN do an OutputTO command in SNP format, but then I'd need to include it
as an object in the SendObject command, and don't have an option for the SNP
format as an included object.

Sarah said:
Type acFormatSNP and see if that works.

Dennis said:
What number do I use for that? There's no "acFormatSnapshot" defined in VB.

Sarah said:
Eventhough it doesn't show it as an option, try it anyways. I was able to
use this feature in Access 2000 specifying the Output format as Snaphot
Format.

:

Ahh, but Snapshot format is NOT one of the allowable Output Formats for that
command in Access 2002. Hence my problem...

:

The sendobject command can also be used in vba. You would specify Snapshot
Format for the Output Format. You can also use the macro to specify the To,
SUBJECT and BODY data. You would refer to a control in your form which
contains these values.

Example:
[Forms]![frmSend]![To]
[Forms]![frmSend]![Subject]
[Forms]![frmSend]![Body])

:

I'm triggering this via VBA. Can I pass the TO, SUBJECT and BODY data to the
macro?

:

Automate sending a report snapshot in e-mail
1. Create a macro.
2. Add the SendObject action to the macro. For example:
Argument: Value
Object Type: Report
Object Name: Summary of Sales by Quarter
Output Format: Snapshot Format
To: All Northwind Traders; Shareholders
Cc: none
Bcc: none
Subject: Quarterly Sales report
Message Text: This is our best quarter in years!
Edit Message: No

Run the macro each time you want to send the report snapshot.

Sarah

:

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.

How can I do that please?

Thanks!
 
G

Guest

Sorry maybe someone else can help you.

Dennis said:
Error 2282:

The format in which you are attempting to output the current object is not
available.

Sarah said:
Type acFormatSNP and see if that works.

Dennis said:
What number do I use for that? There's no "acFormatSnapshot" defined in VB.

:

Eventhough it doesn't show it as an option, try it anyways. I was able to
use this feature in Access 2000 specifying the Output format as Snaphot
Format.

:

Ahh, but Snapshot format is NOT one of the allowable Output Formats for that
command in Access 2002. Hence my problem...

:

The sendobject command can also be used in vba. You would specify Snapshot
Format for the Output Format. You can also use the macro to specify the To,
SUBJECT and BODY data. You would refer to a control in your form which
contains these values.

Example:
[Forms]![frmSend]![To]
[Forms]![frmSend]![Subject]
[Forms]![frmSend]![Body])

:

I'm triggering this via VBA. Can I pass the TO, SUBJECT and BODY data to the
macro?

:

Automate sending a report snapshot in e-mail
1. Create a macro.
2. Add the SendObject action to the macro. For example:
Argument: Value
Object Type: Report
Object Name: Summary of Sales by Quarter
Output Format: Snapshot Format
To: All Northwind Traders; Shareholders
Cc: none
Bcc: none
Subject: Quarterly Sales report
Message Text: This is our best quarter in years!
Edit Message: No

Run the macro each time you want to send the report snapshot.

Sarah

:

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.

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


Sarah said:
Sorry maybe someone else can help you.

Dennis said:
Error 2282:

The format in which you are attempting to output the current object is not
available.

Sarah said:
Type acFormatSNP and see if that works.

:

What number do I use for that? There's no "acFormatSnapshot" defined in VB.

:

Eventhough it doesn't show it as an option, try it anyways. I was able to
use this feature in Access 2000 specifying the Output format as Snaphot
Format.

:

Ahh, but Snapshot format is NOT one of the allowable Output Formats for that
command in Access 2002. Hence my problem...

:

The sendobject command can also be used in vba. You would specify Snapshot
Format for the Output Format. You can also use the macro to specify the To,
SUBJECT and BODY data. You would refer to a control in your form which
contains these values.

Example:
[Forms]![frmSend]![To]
[Forms]![frmSend]![Subject]
[Forms]![frmSend]![Body])

:

I'm triggering this via VBA. Can I pass the TO, SUBJECT and BODY data to the
macro?

:

Automate sending a report snapshot in e-mail
1. Create a macro.
2. Add the SendObject action to the macro. For example:
Argument: Value
Object Type: Report
Object Name: Summary of Sales by Quarter
Output Format: Snapshot Format
To: All Northwind Traders; Shareholders
Cc: none
Bcc: none
Subject: Quarterly Sales report
Message Text: This is our best quarter in years!
Edit Message: No

Run the macro each time you want to send the report snapshot.

Sarah

:

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.

How can I do that please?

Thanks!
 
R

Rick Brandt

Dennis said:
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
[snip]

It is *an* answer, but not to the original question which specified the use of
SendObject(). If you can use Snapshot for OutputTo but not for SendObject then
you are simply missing a registry entry.

Having said that, the Outlook method is far superior to using SendObject so I
would stay with that or automate CDO. I haven't used SendObject for many years
now.
 

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