What event is "New Mail"

  • Thread starter Thread starter Hans Otany
  • Start date Start date
H

Hans Otany

Hi ,

I would like, that the "From" field is filled with a default mail address.
my code is the following:

Sub Von_Feld_STD()

Dim myApp As New Outlook.Application
Dim myItem As Outlook.MailItem

Set myItem = myApp.CreateItem(MailItem)

With myItem
.SentOnBehalfOfName = "(e-mail address removed)"
.To = (e-mail address removed)
.Subject = "Neue Mail"
End With

myItem.Display

End Sub


If I execute the makro, the code works very well but i would like that the
code is executed if I click the "New" button.
What event is it, if I click "New Mail"?

Thanks and Best Regards

Hans
 
That's the NewInspector event. In that event, check whether the item is a
MailItem, and whether it has en EntryID (if so, it's not a new item).

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool:
: <http://www.vboffice.net/product.html?pub=6&lang=en>


Am Mon, 19 May 2008 16:41:12 +0200 schrieb Hans Otany:
 
Back
Top