Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have an access database that spits out an excel file to
my C drive...is there a way that I can have this file automatically emailed to someone? I checked the access NG and they said to check here because the file was now an excel file. I want to run the access database It spits out the excel file and automatically emails it to certain people. Thanks for all your help. Scott |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi scott
If you use Outlook?? I think you can use this without any problems in Access VBA Sub Mail_workbook_Outlook() 'You must add a reference to the Microsoft outlook Library Dim OutApp As Outlook.Application Dim OutMail As Outlook.MailItem Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(olMailItem) With OutMail .To = " .CC = "" .BCC = "" .Subject = "This is the Subject line" .Body = "Hi there" 'You can add files like this .Attachments.Add ("C:\test.xls") .Send 'or use .Display End With Set OutMail = Nothing Set OutApp = Nothing End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "scott" wrote in message ... I have an access database that spits out an excel file to my C drive...is there a way that I can have this file automatically emailed to someone? I checked the access NG and they said to check here because the file was now an excel file. I want to run the access database It spits out the excel file and automatically emails it to certain people. Thanks for all your help. Scott |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you for this info..I do have one question..Where do
I put the code and how do I run it? I tried copying it into a macro and using RUN CODE in macro like this RUNCODE Mail_workbook_Outlook() but I got an error. I am using access 97. Thank you for all your help. Scott -----Original Message----- Hi scott If you use Outlook?? I think you can use this without any problems in Access VBA Sub Mail_workbook_Outlook() 'You must add a reference to the Microsoft outlook Library Dim OutApp As Outlook.Application Dim OutMail As Outlook.MailItem Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(olMailItem) With OutMail .To = " .CC = "" .BCC = "" .Subject = "This is the Subject line" .Body = "Hi there" 'You can add files like this .Attachments.Add ("C:\test.xls") .Send 'or use .Display End With Set OutMail = Nothing Set OutApp = Nothing End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "scott" wrote in message ... I have an access database that spits out an excel file to my C drive...is there a way that I can have this file automatically emailed to someone? I checked the access NG and they said to check here because the file was now an excel file. I want to run the access database It spits out the excel file and automatically emails it to certain people. Thanks for all your help. Scott . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The code you must place in a normal module
Did you add a reference to Outlook? 1) Go to the VBA editor, Alt -F11 2) ToolsReferences in the Menu bar 3) Place a Checkmark before Microsoft Outlook ? Object Library ? is the Excel version number -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "scott" wrote in message ... Thank you for this info..I do have one question..Where do I put the code and how do I run it? I tried copying it into a macro and using RUN CODE in macro like this RUNCODE Mail_workbook_Outlook() but I got an error. I am using access 97. Thank you for all your help. Scott -----Original Message----- Hi scott If you use Outlook?? I think you can use this without any problems in Access VBA Sub Mail_workbook_Outlook() 'You must add a reference to the Microsoft outlook Library Dim OutApp As Outlook.Application Dim OutMail As Outlook.MailItem Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(olMailItem) With OutMail .To = " .CC = "" .BCC = "" .Subject = "This is the Subject line" .Body = "Hi there" 'You can add files like this .Attachments.Add ("C:\test.xls") .Send 'or use .Display End With Set OutMail = Nothing Set OutApp = Nothing End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "scott" wrote in message ... I have an access database that spits out an excel file to my C drive...is there a way that I can have this file automatically emailed to someone? I checked the access NG and they said to check here because the file was now an excel file. I want to run the access database It spits out the excel file and automatically emails it to certain people. Thanks for all your help. Scott . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Emailing PART of a spreadsheet | Excel Discussion (Misc queries) | |||
emailing spreadsheet | Excel Discussion (Misc queries) | |||
emailing from existing spreadsheet | Excel Discussion (Misc queries) | |||
Emailing a spreadsheet | Excel Discussion (Misc queries) | |||
Emailing a form from a spreadsheet | Links and Linking in Excel |