Snapshot Viewer

doulostheou

Registered User.
Local time
Today, 15:50
Joined
Feb 8, 2002
Messages
314
I have gotten the snapshot viewer, but now I cannot get it to work. I tried writing a macro that would use SendObject to put a snapshot of the report into Outlook. I wrote the macro in order to create an icon for the toolbar. I get the error "The command or action 'SendObject' isn't available now. Use only the commands and macro actions that are currently available for this database." When I try right clicking on the report the Send option from the popup menu is inactive.

Any suggestions?
 
I haven't used macros in years but here is code that will do what you ask:

Private Sub EmailSnapshotFile(strReport As String, strRecipNames As String)
On Error GoTo Err_EmailSnapshotFile

DoCmd.Hourglass True

If Len(strRecipNames) > 0 Then
&nbsp DoCmd.SendObject acSendReport, strReport, "Snapshot Format", strRecipNames
End If

Exit_EmailSnapshotFile:
&nbsp DoCmd.Hourglass False
&nbsp Exit Sub

Err_EmailSnapshotFile:
&nbsp If Err.Number = 2501 Then
&nbsp &nbsp Resume Exit_EmailSnapshotFile
&nbsp Else
&nbsp &nbsp MsgBox Err.Number & vbCrLf & Err.Description
&nbsp &nbsp Resume Exit_EmailSnapshotFile
&nbsp End If
End Sub

HTH
RDH
 
Can you attach code to a toolbar button?
 
I finally figured this one out. It was probably commonplace for everyone else. You can simply use the RunCode command in a macro and write a function for a module. I'll try the above code to see if it fixes my SendObject problem.
 

Users who are viewing this thread

Back
Top Bottom