CharlesWhiteman
Registered User.
- Local time
- Today, 03:32
- Joined
- Feb 26, 2007
- Messages
- 421
I am using the following code which successfully generates an outlook email message with a template. but when I add the myItem.Body I lose my template (which is basically a blank email with a sigature). Any clues?
rivate Sub CbSendEmail_Click()
If IsNull(Me.[Email Address]) Then
MsgBox "No Email Address For This Contact", , "No Valid Email Address"
Else
Dim TEMPLATE As String
TEMPLATE = DLookup("EmailTemplate", "Tblconfiguration")
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItemFromTemplate(TEMPLATE)
myItem.Subject = "Integrasoft Ltd"
myItem.To = [Email Address]
myItem.Display
'myItem.Body = Forms.frmdatabase.AccountNumber THIS IS THE PROBLEM LINE WHERE IF DE-REM'D MY TEMPLATE DOES NOT DISPLAY
End If
End Sub
rivate Sub CbSendEmail_Click()
If IsNull(Me.[Email Address]) Then
MsgBox "No Email Address For This Contact", , "No Valid Email Address"
Else
Dim TEMPLATE As String
TEMPLATE = DLookup("EmailTemplate", "Tblconfiguration")
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItemFromTemplate(TEMPLATE)
myItem.Subject = "Integrasoft Ltd"
myItem.To = [Email Address]
myItem.Display
'myItem.Body = Forms.frmdatabase.AccountNumber THIS IS THE PROBLEM LINE WHERE IF DE-REM'D MY TEMPLATE DOES NOT DISPLAY
End If
End Sub