Microsoft
Software
Hardware
Network
Question : HELP!!! email a .snp report....
I need to email (from within Access) a report to people on our network. I'd like to send the snapshot viewer with the .snp report, however I can't send (using SendObject method)the report as a .snp file type. I can save it as a .snp file, but how do you then send it via Outlook? How do you include the snapshot viewer in the same email as well? The report will always have the same name and will always be saved to the same folder. Is Access-Outlook automation the easiest way to do this?
Answer : HELP!!! email a .snp report....
This seems to work perfectly.
Remember to reference Outlook.
When in design mode of a module, Select Tools, References and scroll down to Miscrosoft Outlook x.0 Object Library.
Sub cmdEmailSnapshot()
'=========================
==========
==========
' Purpose: E-Mail Graph - Converted to snapshot sender
' E-Mail:
[email protected]
' Programmer: Graeme Wilson
' Edited/Changed: Trygve
'=========================
==========
==========
On Error GoTo cmdEmailSnapshot_Err
Dim strErrMsg As String 'For Error Handling
Dim olApp As New Outlook.Application
Dim olNameSpace As Outlook.NameSpace
Dim olMail As Outlook.MailItem
Dim strFileName As String
Dim strViewerPath As String
Set olNameSpace = olApp.GetNamespace("MAPI")
Set olMail = olApp.CreateItem(olMailIte
m)
strFileName = "c:\ETPMVM_Demo_None_.snp"
strViewerPath = "c:\misc\install\tools\snp
vw80.exe"
With olMail
.To = "
[email protected]
"
.Subject = "Snapshot report " & Format(Now(), "dd mmm yyyy hh:mm")
.Attachments.Add strFileName ' The snapshot file
.Attachments.Add strViewerPath ' The viewer.
.ReadReceiptRequested = False
.Send
End With
Msgbox vbCrLf & "Snapshot report has been E-Mailed", _
vbInformation + vbOKOnly, "Chart Exported :"
cmdEmailSnapshot_Exit:
Set olApp = Nothing
Set olMail = Nothing
Exit Sub
cmdEmailSnapshot_Err:
Select Case Err
Case Else
strErrMsg = strErrMsg & "Error #: " & Format$(Err.Number) & vbCrLf & vbCrLf
strErrMsg = strErrMsg & "Error Description: " & Err.Description & vbCrLf
Msgbox strErrMsg, vbInformation, "cmdEmailSnapshot"
Resume cmdEmailSnapshot_Exit
End Select
End Sub
Random Solutions
Allow real desktop access to Windows Server 2008 R2
Autonew in Excel
IE7 and blank pages
How do I number couples of data in an MS Access 2007 Report?
.NET CE C# program not updating with time zone change
Select table data from a different SQL instance?
Underlining spaces
Visual Studio 2005, Crystal Report Viewer 10, displaying dynamic image
VB.Net move Items from ListBox to Textboxes
What sort of utility will provide autocomplete suggestions while I am typing text within applications such as Microsoft Word, Internet Explorer, notepad, etc.?