What event is "New Mail"

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
 
M

Michael Bauer [MVP - Outlook]

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:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top