Access To Outlook Email Issue (1 Viewer)

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
:confused:'myItem.Body = Forms.frmdatabase.AccountNumber THIS IS THE PROBLEM LINE WHERE IF DE-REM'D MY TEMPLATE DOES NOT DISPLAY
End If
End Sub
 

DJkarl

Registered User.
Local time
Yesterday, 21:32
Joined
Mar 16, 2007
Messages
1,028
Maybe try?

myItem.Body = Forms.frmdatabase.AccountNumber & myItem.Body
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 19:32
Joined
Aug 30, 2003
Messages
36,127
This is a shot in the dark, but if that doesn't work try switching the last 2 lines around, so that the display line is last.
 

CharlesWhiteman

Registered User.
Local time
Today, 03:32
Joined
Feb 26, 2007
Messages
421
Thanks for the replies. Both worked in exactly the same way and have achieved in principle what i wanted to. However, whereas when the template file loads there is a structured signature with logo and web hyperlink, with the code as above i lose the formating on the signature.

Maybe another way of applying a template would work around the issue but I have found little on the subject on the forums.
 

CharlesWhiteman

Registered User.
Local time
Today, 03:32
Joined
Feb 26, 2007
Messages
421
This is the reult where IS002 is the "forms.frmdatabase.accountnumber" and logosmall should be a imagine but is just a reference to the image.

Charles Whiteman
Integrasoft Limited

07766 023 273

HYPERLINK "http://www.integrasoft.co.uk"www.integrasoft.co.uk




Integrasoft - Logo Small i


This message is for the named person's use only. It may contain proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any miss-transmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Integrasoft is a company registered in England, number 6354489. All outgoing email transmissions are scanned for viruses.


IS002
 

Users who are viewing this thread

Top Bottom