View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jan Karel Pieterse Jan Karel Pieterse is offline
external usenet poster
 
Posts: 535
Default Opening a new mail dialog box in Excel using vba

Hi Michelle,

I would like to use Excel that runs a macro to open up a
new mail in Outlook.


Like this:

Sub MailIt()
Dim oMailItem As Object
Dim oOLapp As Object
Set oOLapp = CreateObject("Outlook.application")
Set oMailItem = oOLapp.CreateItem(0)
With oMailItem
.To =
.CC =
.Subject = "Your subject goes here"
.Body = "Hi there!"
.Display
End With
Set oOLapp = Nothing
Set oMailItem = Nothing
End Sub


Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com