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

Grabbing email addresses in Outlook

Status
Not open for further replies.

Ma3x323

Programmer
Jun 27, 2001
148
US
HI,
Wondering if any of you can help me here. I am making a program which can grab all the email addresses in outlook. Meaning it will look through every single email and look at TO, CC, BCC and the body itself and find email addresses there. Then it would go to the address book and grab all email addresses there. Probably put it all in a text file. I am wondering how to do this. I don't know much about VBA but I'd like to know how this works.
If you think coding it in C++ would be better I would gladly appreciate your opinion, since this is supposed to be a console app program.

Thanks in advance
-Feryl
--> Just a silly software engineer wannabee.
If you feel a post has been helpful to you, click on the link at the bottom of their post to cast a vote for "TipMaster Of The Week". You don't need to be the one who asked the question to vote.
 
Hi,

> I am making a program which can grab all the email addresses in outlook

Try this function that grab One contact by a Full Name. change for grab all contacts

---
Function GetContactItem(strFullName As String) As Outlook.ContactItem
' This procedure returns an Outlook ContactItem with a FullName
' property that matches the full name passed in the strFullName
' argument to the procedure.
Dim fldContacts As Outlook.MAPIFolder
Dim objItem As Object
Dim strCriteria As String

' Use the InitializeOutlook procedure to initialize global
' Application and NameSpace object variables, if necessary.
If golApp Is Nothing Then
If InitializeOutlook = False Then
MsgBox "Unable to initialize Outlook Application " _
& "or NameSpace object variables!"
Exit Function
End If
End If

Set fldContacts = gnspNameSpace.GetDefaultFolder(olFolderContacts)
For Each objItem In fldContacts.Items
If UCase$(objItem.FullName) = UCase$(strFullName) Then
Set GetContactItem = objItem
Exit Function
End If
Next objItem

Set GetContactItem = Nothing

End Function

---

>If you think coding it in C++ would be better I would gladly appreciate your opinion, since this is supposed to be a console app program.

I can not help you on this one.
Best Regards

---
JoaoTL
NOSPAM_mail@jtl.co.pt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top