MsAccess VBA to the outlook outbox
I am trying to send an automatic mail from MsAccess VBA to the outlook outboxes, when this message is sent, this error appears.
A program is trying to automatically send e-mail on your behalf.
The help button says:
A program is trying to send mail using Item.Send
A program is trying to automatically send e-mail using a Microsoft Outlook Visual Basic Application command, Item.Send. If you want this program to send this e-mail, click Yes. To stop the program, click No.
If you are unsure which program is sending the e-mail or why, you may want to click No to avoid any possible spread of viruses.
Note When this message is displayed, the Yes button is not available for 5 seconds.
How can I disable this protection as we use MS Outlook for only sending email?
Re: MsAccess VBA to the outlook outbox
It's a safety feature of Microsoft Outlook. it helps to prevent unwarranted use of the email system, particularly by viruses. Since you are activating it, you need a third party work-around.
Download Express Clickyes. If you are using a program that causes Outlook to generate the prompt, you ll find this tiny tool very handy.:cool:
Re: MsAccess VBA to the outlook outbox
Thank you for your note:
A - I will try some code this week
B - If the code we try does not work I will spend the $40.00 on the product you suggest.
Re: MsAccess VBA to the outlook outbox
- Create or buy an ActiveX/DLL that uses Extended MAPI to manage the creation of e-mails. The Outlook Security Model only effects 'Simple MAPI' functions not 'Extended MAPI' ones but unfortunately you can't directly interface with Extended MAPI functions from VB/VBA - hence the need for an ActiveX control or a DLL that would be written in a lower level language. Outlook Redemption is a popular DLL solution that uses Extended MAPI.
- Create or buy an application that simply presses the 'Yes' button after the elapsed 5 second delay. In my opinion this is a bad idea - but if you want to follow this route, have a search around the net.
- If using Outlook 2003, the VBA code stored inside of the VBA Project of Outlook is assumed to be "Trusted" - this then bypasses the warning messages - then you can call this VBA code using automation of Outlook.
Requirements :
Outlook 2003 (earlier versions of Outlook do not "trust" the VBA code inside the Outlook VBA Project)
Advantages :
- Doesn't need any DLLs or external libraries.
Disadvantages :
- You need to add some code to the VBA project inside of Outlook
- Outlook 'Macro Security' level must be set to LOW or MEDIUM