You are welcome. I am glad that I could be of help.
Jim Wagner
On Friday, August 7, 2015 6:07 AM, "drnorbert@msn.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com> wrote:
Bill,
I am looking now to switch to vbMAPI.
The following is an update of the code:
Private Sub cmdEmail1_Click()
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Dim strbody As String
Dim strPDF As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
strbody = "Dear Aaron," & vbNewLine & "Enclosed is the requested information"
strPDF = Me.txtFile
On Error Resume Next
With OutMail
.To = "drnorbert@msn.com"
.CC = ""
.BCC = ""
.Subject = "Important..."
.Body = strbody
.Recipients.ResolveAll
'.SendUsingAccount = OutApp.Session.Accounts.Item(2) '2nd email
.SentOnBehalfOfName = "drChiche@hotmail.com" 'Jim Wagner
.Attachments.Add strPDF 'attachments
.Send
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
I am still searching for a flag from Oulook 2013 to Access 2013 which will indicate that the email was sent (or at least is in the Outlook Sent Items Folder and not in the Outbox Folder)
I am looking now to switch to vbMAPI.
The following is an update of the code:
Private Sub cmdEmail1_Click()
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Dim strbody As String
Dim strPDF As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
strbody = "Dear Aaron," & vbNewLine & "Enclosed is the requested information"
strPDF = Me.txtFile
On Error Resume Next
With OutMail
.To = "drnorbert@msn.com"
.CC = ""
.BCC = ""
.Subject = "Important..."
.Body = strbody
.Recipients.ResolveAll
'.SendUsingAccount = OutApp.Session.Accounts.Item(2) '2nd email
.SentOnBehalfOfName = "drChiche@hotmail.com" 'Jim Wagner
.Attachments.Add strPDF 'attachments
.Send
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
I am still searching for a flag from Oulook 2013 to Access 2013 which will indicate that the email was sent (or at least is in the Outlook Sent Items Folder and not in the Outbox Folder)
__._,_.___
Posted by: Jim Wagner <luvmymelody@yahoo.com>
| Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (9) |
.
__,_._,___
Tidak ada komentar:
Posting Komentar