![]() |
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 | Search this Thread | Display Modes |
#5
|
|||
|
|||
![]()
Here's some sample code I use in Excel to send emails using Outlook.
Dim Outlook As Outlook.Application Dim OutlookMsg As Outlook.MailItem Dim OutlookRecip As Outlook.Recipient Dim OutlookAttach As Outlook.Attachment Set Outlook = CreateObject("outlook.application") Set OutlookMsg = Outlook.CreateItem(olMailItem) With OutlookMsg .SentOnBehalfOfName = " .ReplyRecipients.Add ") .Subject = "Read me!" .Importance = olImportanceHigh .Sensitivity = olConfidential .BodyFormat = olFormatHTML .HTMLBody = "Your message here" Set OutlookRecip = ") OutlookRecip.Type = olTo Set OutlookAttach = .Attachments.Add("C:\Documents And Settings\username\Desktop\filename.xls") .Send ' or .Display if you want to preview the message 'destroy variables Set OutlookRecip = Nothing Set OutlookAttach = Nothing Set OutlookMsg = Nothing Set Outlook = Nothing Beware Outlook security warning! HTH, JP On Nov 2, 9:23 am, dmklaus wrote: Outlook 2003, the sender would be a mailbox (for example: ) "dmklaus" wrote: I am building automated email messaging, populating the Subject, message and recipients from within my application. I need to popultat the From: also, does anyone know how to code this?- Hide quoted text - - Show quoted text - |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Programmatically sending email via Outlook COM Add-In | pollyanna65 | Add-ins for Outlook | 6 | January 29th 07 04:47 PM |
How can I programmatically display an email message saved in a msg file? | Clive | Outlook - Using Forms | 1 | November 29th 06 09:39 PM |
Programmatically sending email from Access | scariharry | Outlook and VBA | 0 | July 5th 06 05:08 PM |
Sending a test message works; sending a message doesn't? | NancyTG | Outlook - Installation | 9 | June 22nd 06 04:00 PM |
Error message when sending message in Outlook | Vikes | Outlook - General Queries | 0 | February 17th 06 10:02 PM |