I am attempting to modify your code to send a report through email instead of
print it. Here is what I have tried:
On error resume next
call RunReport("database.mdb","OpenIssues","c:\OpenIssues.snp","Snapshot
Format")
Function RunReport(strDbPathAndName,strRptName,strDocPath,strDocFmt)
On Error Resume Next
Dim objDb
Set objDb = CreateObject("Access.Application")
objDb.Visible=True
objDb.OpenCurrentDatabase (strDbPathAndName)
objDb.DoCmd.SendObject acSendReport, strRptName, strDocFmt, "(e-mail address removed)", , ,
"Open Issues Report",,True
DoEvents
objDb.CloseCurrentDatabase
objDb.Quit
End Function
The database opens, but no email is generated. the sendobject command works
when applied to a command button in access, but seems to do nothing here.
I am using Outlook 2003 and it is always running on my machine so the is no
need to start Outlook in this code.
Any Ideas would be greatly appreciated,
Mike