Chi1linVi1lain
Registered User.
- Local time
- Yesterday, 23:00
- Joined
- Sep 22, 2011
- Messages
- 11
All,
I've been searching all morning for a way to set the "FROM" email address in a new email message in Outlook 2007 that's automated from Access 2007.
FYI - I'm writing this in a test DB so I can transfer the working code into a functional DB.
Here's the code I have:
(I placed a ' in the "Error" line to find where my code was failing so please ignore that)
End With
OutApp.Quit
Set OutMail = Nothing
Set OutApp = Nothing
Exit_C1Email_DblClick:
Exit Sub
Err_C1Email_DblClick:
MsgBox Err.Description
Resume Exit_C1Email_DblClick
End Sub
Any and all help would be greatly appreciated. THANKS!
Johnathon
I've been searching all morning for a way to set the "FROM" email address in a new email message in Outlook 2007 that's automated from Access 2007.
FYI - I'm writing this in a test DB so I can transfer the working code into a functional DB.
Here's the code I have:
(I placed a ' in the "Error" line to find where my code was failing so please ignore that)
Private Sub C1Email_Click()
'On Error GoTo Err_C1Email_DblClick
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Dim EmailAddress As String
Set OutApp = CreateObject("Outlook.Application", "localhost")
Set OutMail = OutApp.CreateItem(olMailItem)
Forms(1).Command0.SetFocus
With OutMail
.From = "sales@finishing-technology.com"
.To = Me.TeamLeader.Column(1)
.CC = Me.AssignedTo
.BCC = ""
.Subject = "TEST"
.Body = "Testing 'From Email' address coding"
.Display 'Or .Send once happy with test results
'On Error GoTo Err_C1Email_DblClick
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Dim EmailAddress As String
Set OutApp = CreateObject("Outlook.Application", "localhost")
Set OutMail = OutApp.CreateItem(olMailItem)
Forms(1).Command0.SetFocus
With OutMail
.From = "sales@finishing-technology.com"
.To = Me.TeamLeader.Column(1)
.CC = Me.AssignedTo
.BCC = ""
.Subject = "TEST"
.Body = "Testing 'From Email' address coding"
.Display 'Or .Send once happy with test results
End With
OutApp.Quit
Set OutMail = Nothing
Set OutApp = Nothing
Exit_C1Email_DblClick:
Exit Sub
Err_C1Email_DblClick:
MsgBox Err.Description
Resume Exit_C1Email_DblClick
End Sub
Johnathon