export to snapshot for email

  • Thread starter Thread starter news.microsoft.com
  • Start date Start date
N

news.microsoft.com

Hi,
I have a report that has a toolbar associated with it - just a normal print
button.

I want to be able to add a button that will allow the user to export the
report (from the preview screen) into a snapshot so that it can be emailed.

How can I do this?
 
In a standard module add the following code:

Public Function fSnapshot()
'if you want to email it as an attachment, use
DoCmd.SendObject acSendReport, Screen.ActiveReport.name, acFormatSNP

'if you just want to create a snapshot file to manually attach to an
email, use
DoCmd.OutputTo acOutputReport, Screen.ActiveReport.name, "Snapshot
Format (*.snp)", "C:\my documents\yourfilename.snp", False
End Function

add a custon command to your toolbar and in the onaction property type
fSnapshot

You can look in help for all the other options on the sendobject and
outputto methods.
 
Thanks - work a treat!
Alphonse Giambrone said:
In a standard module add the following code:

Public Function fSnapshot()
'if you want to email it as an attachment, use
DoCmd.SendObject acSendReport, Screen.ActiveReport.name, acFormatSNP

'if you just want to create a snapshot file to manually attach to an
email, use
DoCmd.OutputTo acOutputReport, Screen.ActiveReport.name, "Snapshot
Format (*.snp)", "C:\my documents\yourfilename.snp", False
End Function

add a custon command to your toolbar and in the onaction property type
fSnapshot

You can look in help for all the other options on the sendobject and
outputto methods.
 
Back
Top