If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Emailing from Access
Not sure if this is correct forum
Am looking to be able to set up routine to allow me to send emails from data held in Access Query - either through outlook or some other third party program. Anyone anyu ideas as to best way to set this up please Thanks Alex |
#2
|
|||
|
|||
First off, and I'm not trying to be rude, just trying to point you in the
proper location, you really should post this type of message in the programming newsgroup (...access.modulesdaovba). Besides that, you want to use a routine like: ********************** Function SendMessage(Dwg As String, Issue As String, Lead As String) Dim objOutlook As Outlook.Application Dim objOutlookMsg As Outlook.MailItem Dim objOutlookRecip As Outlook.Recipient Dim objOutlookAttach As Outlook.Attachment ' Create the Outlook session. Set objOutlook = CreateObject("Outlook.Application") ' Create the message. Set objOutlookMsg = objOutlook.CreateItem(olMailItem) With objOutlookMsg ' Add the To recipient(s) to the message. Set objOutlookRecip = ) 'Check objOutlookRecip.Type = olTo ' Add the CC recipient(s) to the message. 'Set objOutlookRecip = .Recipients.Add("Andrew Fuller") 'objOutlookRecip.Type = olCC ' Set the Subject, Body, and Importance of the message. .Subject = "Some Subject Line You Want To Appear" .Body = "Actual Content of the E-mail" '.Importance = olImportanceHigh 'High importance ' Add attachments to the message. 'If Not IsMissing(AttachmentPath) Then ' Set objOutlookAttach = .Attachments.Add(AttachmentPath) 'End If ' Resolve each Recipient's name. 'For Each objOutlookRecip In .Recipients ' objOutlookRecip.Resolve ' If Not objOutlookRecip.Resolve Then ' objOutlookMsg.Display 'End If 'Next .Send End With Set objOutlookMsg = Nothing Set objOutlook = Nothing End Function *************************** This should at least get you started! Hope it helps, Daniel "Alex" wrote in message ... Not sure if this is correct forum Am looking to be able to set up routine to allow me to send emails from data held in Access Query - either through outlook or some other third party program. Anyone anyu ideas as to best way to set this up please Thanks Alex |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Conversion Problems | Katherine R | New Users | 11 | December 19th, 2004 12:38 AM |
Data from Excel to Access | Database Design | 2 | August 20th, 2004 12:53 PM | |
Access user profile | Michael Breitsameter | General Discussion | 7 | July 23rd, 2004 07:47 AM |
Useless Access 2003 | tired, angry, sucidial and bored | General Discussion | 10 | July 21st, 2004 11:52 PM |