Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / April 2006

Tip: Looking for answers? Try searching our database.

Emailing a SNAPSHOT file via SENDOBJECT

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dennis - 07 Apr 2006 18:51 GMT
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!
Sarah - 07 Apr 2006 20:12 GMT
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
[quoted text clipped - 3 lines]
>
> Thanks!
Dennis - 07 Apr 2006 20:47 GMT
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.
[quoted text clipped - 21 lines]
> >
> > Thanks!
Sarah - 07 Apr 2006 21:01 GMT
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?
[quoted text clipped - 24 lines]
> > >
> > > Thanks!
Dennis - 07 Apr 2006 21:06 GMT
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,
[quoted text clipped - 34 lines]
> > > >
> > > > Thanks!
Sarah - 07 Apr 2006 21:14 GMT
Sorry you didn't specify that you were working in Access 2002.  I assumed 2003.

> Ahh, but Snapshot format is NOT one of the allowable Output Formats for that
> command in Access 2002. Hence my problem...
[quoted text clipped - 37 lines]
> > > > >
> > > > > Thanks!
Sarah - 07 Apr 2006 21:16 GMT
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...
[quoted text clipped - 37 lines]
> > > > >
> > > > > Thanks!
Dennis - 07 Apr 2006 21:19 GMT
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
[quoted text clipped - 41 lines]
> > > > > >
> > > > > > Thanks!
Sarah - 07 Apr 2006 21:30 GMT
Type acFormatSNP and see if that works.

> What number do I use for that? There's no "acFormatSnapshot" defined in VB.
>
[quoted text clipped - 43 lines]
> > > > > > >
> > > > > > > Thanks!
Dennis - 07 Apr 2006 21:34 GMT
Error 2282:

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

> Type acFormatSNP and see if that works.
>
[quoted text clipped - 45 lines]
> > > > > > > >
> > > > > > > > Thanks!
Sarah - 07 Apr 2006 21:37 GMT
Sorry maybe someone else can help you.

> Error 2282:
>
[quoted text clipped - 50 lines]
> > > > > > > > >
> > > > > > > > > Thanks!
Dennis - 10 Apr 2006 18:12 GMT
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

> Sorry maybe someone else can help you.
>
[quoted text clipped - 52 lines]
> > > > > > > > > >
> > > > > > > > > > Thanks!
Rick Brandt - 11 Apr 2006 12:30 GMT
> This was the answer:
>
[quoted text clipped - 3 lines]
>   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.

Signature

Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt   at   Hunter   dot   com

Dennis - 07 Apr 2006 21:36 GMT
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.

> Type acFormatSNP and see if that works.
>
[quoted text clipped - 45 lines]
> > > > > > > >
> > > > > > > > Thanks!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.