![]() |
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 |
#1
|
|||
|
|||
![]()
I have an automated program that sends emails from within Accrss. Part
of the code is below, but as well as the "To" and "Cc" I would also like to use the "From" box, Could somebody please advise me how to code this. With thanks Bob Sub sbSendLetter(Optional AttachmentPath) Dim objOutlook As Outlook.Application Dim objOutlookMsg As Outlook.MailItem Dim objOutlookRecip As Outlook.Recipient Dim objOutlookAttach As Outlook.Attachment On Error GoTo ErrorMsgs ' 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. Substitute your names here ' your names here. Set objOutlookRecip = .Recipients.Add([Forms]![Send_Letters]! [Recipiant]) objOutlookRecip.Type = olTo ' Add the CC recipient(s) to the message. Set objOutlookRecip = .Recipients.Add([Forms]![Send_Letters]! [Copy reply to]) objOutlookRecip.Type = olCC ' Set the Subject, Body, and Importance of the message. |
Ads |
#2
|
|||
|
|||
![]()
Set the SentOnBehalfOfName property (Exchange specific); you must have an
explicit permission to send on behalf of the specified user. In case of sending through an SMTP server, see http://www.dimastr.com/redemption/faq.htm#14 Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Box666" wrote in message ups.com... I have an automated program that sends emails from within Accrss. Part of the code is below, but as well as the "To" and "Cc" I would also like to use the "From" box, Could somebody please advise me how to code this. With thanks Bob Sub sbSendLetter(Optional AttachmentPath) Dim objOutlook As Outlook.Application Dim objOutlookMsg As Outlook.MailItem Dim objOutlookRecip As Outlook.Recipient Dim objOutlookAttach As Outlook.Attachment On Error GoTo ErrorMsgs ' 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. Substitute your names here ' your names here. Set objOutlookRecip = .Recipients.Add([Forms]![Send_Letters]! [Recipiant]) objOutlookRecip.Type = olTo ' Add the CC recipient(s) to the message. Set objOutlookRecip = .Recipients.Add([Forms]![Send_Letters]! [Copy reply to]) objOutlookRecip.Type = olCC ' Set the Subject, Body, and Importance of the message. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
"Outlook 2007" +"The Messenger interface has returned an unknown error" | deleteriousone | Outlook - General Queries | 0 | February 7th 07 12:48 AM |
Outlook 2007 / 2003: Error 0x800CCC81 - E-Mail address with "." before "@" | Stephan Kuehn | Outlook - General Queries | 10 | January 25th 07 06:09 PM |
Include "Telecommuting" or "Teleworking" as a "Show time as" statu | Gordon Greene | Outlook - Calandaring | 0 | July 31st 06 03:37 PM |
Cannot "Open" "Import/Export' or use "Data File Management" | Ed Isenberg | Outlook - Installation | 3 | July 16th 06 12:31 AM |
Outlook express address book, "tools", "option" feature missing f. | Brad | Outlook - Using Contacts | 3 | March 11th 06 11:46 PM |