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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send Email though MS Outlook

Status
Not open for further replies.
Mar 10, 2010
2
US
I am using Access 2003 as database.
I have an Excel file with Employee which would be placed in my "C:\" folder on a daily basis.
It would be stored as "C:\" & [ Today's Date ] & " Employee.xls".
For example today's file is
C:\03-10-2010 Employee.xls.

I would like to write a macro in Visual Basic or MS Access VBA which would email this Excel file to "Rsmith@XYZ.com".

Could some one please suggest me a code to send email through MS Outlook.
 
Use either the Workbook.SendMail method in excel VBA or the DoCmd.SendObject method in access VBA.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thank you for the suggestion. This works fine. When I am using this method, the MS Outlook is displaying an alert that another program is trying to access MS Outlook and if it can allow this.

I would not like this to be displayed because, it is a bit bothersome for the end users, and also it is not possible for me to set this code as an automated task.
Could you please suggest, as to how I can avoid MS Outlook display this message.

Thanks
 
Do a google search for outlook object model guard

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top