Snapshot format

halem2

Registered User.
Local time
Today, 11:44
Joined
Nov 8, 2006
Messages
180
Hi All:

using Access 2000.

When you create a command button to email, is there a way to eliminate all other formats except SNAPSHOT from the Send window?

thanks
 
So long as it's a standard file dialog box, you should be able to programmatically use the FileDialog object (requires the MS Office X.0 Object Library) and then use the Filter method:

FileDialogObject.Filters.Clear
FileDialogObject.Filters.Add "Snapshot","*.snp"
 
If you are using outlook as your email - I wrote a an function for this posted here.
 
Moniker:

how would you use that code? I'm trying to learn VBA so I'm kinda lost.

thanks
 
MicroE:

how can I use your function? I'm assuming I have to create a module or it but how do I run it or call it?

thanks
 
Simply copy and paste the code into a new module. On the Click event of your command button select Event procedure, click the build button and code:
EmailSnpFile

Make sure to add the Microsoft Outlook Object Library to your References (Tools > References from the Menu Bar in VBA Editor).
 
MicroE:

thanks! It works like a charm.

Question: is there a waynto populate the "To" field with the email of the current user ini the form?

thanks!
 
Does your application currently capture the user though some king of login? That function would have to exits first. Then the code cam be modified as follows:
---------------------------
Function EmailSnpFile(strEmail As String)

Dim olApp As Outlook.Application
Dim objMail As Outlook.MailItem
Set olApp = Outlook.Application
Dim strPath As String

'Output Report as Snapshot file
strPath = CurrentProject.Path
DoCmd.OutputTo acOutputReport, "Your Report Name", acFormatSNP, strPath & "\Report.snp"

'Create e-mail item
Set objMail = olApp.CreateItem(olMailItem)

With objMail
.To = strEmail
.Subject = "Your Subject"
.BodyFormat = olFormatHTML
.HTMLBody = "<HTML><BODY>" & "Your Email Body" & "</BODY></HTML>"
.Attachments.Add strPath & "\Report.snp"
.Display
End With

End Function
---------------------------
Then the Call from the command button would need to be:
EmailSnpFile me![User email field]
 

Users who are viewing this thread

Back
Top Bottom