Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending Automated Email from Access 2003 App

Status
Not open for further replies.

Toga

Technical User
Jul 21, 2000
234
US
I'm trying to set up to have an Access application automatically start up at a predefined time using the scheduler, compile and send out reports each morning to people on our LAN.....but a message box come up requiring me to acknowledge it's OK before sending. Is there any way to get around that message box....without having to pay for a digital ID? I understand it's for security reasons.....but it's my own program doing the sending! Is there a way I can log on or something???? This message box defeats the purpose of trying to automate these reports so each user isn't spending time having to open and compile them individually.

Details of my test code and the message box below.

Public Sub SendMail()
Dim appOutlook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Set appOutlook = CreateObject("Outlook.Application")
Set MailOutLook = appOutlook.CreateItem(olMailItem)

With MailOutLook
.To = "emailname@address.net"
.Subject = "Name of Report"
.Attachments.Add "Path\Filename"
.Send
End With
End Sub


Instead of just sending, a message box comes up with the following....

A program is trying to send mail using Item.Send
A program is trying to automatically send an e-mail message using a Microsoft Visual Basic Application (VBA) command, Item.Send, from within Microsoft Outlook. If you want this program to send this message, click Yes. To stop the program, click No. If you are unsure which program is sending the message or why the message is being sent, you should click No to help avoid the possible spread of viruses.

Note When this message is displayed, the Yes button is not available for five seconds.

Any help anyone could provide would be greatly appreciated!
 
Do a google search for outlook object model guard

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks...Lots of good stuff there....but I'm still floundering trying to find what I need. Has anyone already solved this problem?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top