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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I just lost .....

Status
Not open for further replies.

bigtings

IS-IT--Management
Oct 4, 2000
8
GB

Hi all can you help as my computer will be the next thing to go out the window

I am trying to read the inbox within outlook and capture the sender's email
address in two places

1) The from box

2) The body of the message



Question 1 what command do I use to read the from address of an email



Question 2 How would I be able to determine if the email is the within the
body of the text what do I write if the it contains a @ .



I have put together a bit of code fi you could tell me what i have to do next

Private Sub email()



Dim objApplication As Outlook.Application

Dim objNameSpace As Outlook.NameSpace

Dim objMAPIFolder As Outlook.MAPIFolder

Dim objContactItem As Outlook.ContactItem

Dim objMailItem As Outlook.MailItem



Set objApplication = New Outlook.Application



Set objNameSpace = objApplication.GetNamespace("MAPI")



Set objMAPIFolder = objNameSpace.GetDefaultFolder(olFolderInbox)



Set objMAPIFolder = objNameSpace.Folders(2).Folders(2)





For Each objMailItem In objMAPIFolder.Items





MsgBox objMailItem.BCC

'End

Debug.Print objMailItem.BCC

Next objMailItem



End Sub



Can you help?


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top