Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

outlook referencing recieved email

Status
Not open for further replies.

apeoortje

Technical User
May 26, 2004
46
0
0
NL
I'm trying the write a peiece of code that verbally noticifies the user of the sender of a incoming message

but I'm stuck with not know the object name for a newly recieved email

code I have so far is:

Set myItem = Application.NewMail
bob = myItem.SenderName
UserForm1.TextToSpeech1.Speak "you have recieved a new email message from " & bob

any Ideas?!?

Thanks

T
 
I've manger to get the to know which was the last email, but I stuck the reading the senders name

this what I have so far:

Private Sub Application_NewMail()
Set myOlApp = CreateObject("Outlook.Application")
Set myNamespace = myOlApp.GetNamespace("MAPI")
Set myFolder = myNamespace.GetDefaultFolder(olFolderInbox)
myFolder.Display
Set myItem = myFolder.Items.GetLast()
Set bob = myItem.SenderName
UserForm1.TextToSpeech1.Speak "you have recieved a new email message from " & bob
End Sub
 
I've managed to slove the problem,

if anyone is interested it's

Private Sub Application_NewMail()

Dim objItem As Outlook.MailItem
Set objItem = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Items.GetLast()
UserForm1.TextToSpeech1.Speak "You have recieved a new email message from, " & objItem.SenderName

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top