abitslow
Technical User
- Apr 25, 2003
- 44
I can't seem to work out the code for launching Outlook from Excel. I want to assign a macro to a button which will open a mail message addressed to me. Excel doen't seem to recognise the commands. My attempt so far:
Many thanks in advance,
Matt.
Code:
Dim olApp As Outlook.Application
Dim olMsg As Outlook.MailItem
Dim eglAdd As Outlook.Recipient
'Create an instance of Outlook
Set olApp = CreateObject("Outlook.Application")
olApp.Visible = True
'Create email Item
Set olMsg = OLApp.CreateItem(olMailItem)
With OLMsg
'Set body format to HTML
.BodyFormat = olFormatHTML
.HTMLBody = "<HTML><H2>The body of this message will appear in HTML.</H2><BODY>Please indicate your problem below:</BODY></HTML>"
.Display
End With
Set eglAdd = OLMsg.Recipients.Add("info@expgeo.co.uk")
End Sub
Many thanks in advance,
Matt.