How to get outlook contacts from pst file

V

vocsok

Hi

I've taken home the pst file containing the copy of my mails from my
workplace and I would like to let to know all my mail mates about my new
email address.
My question: how can I get the mail addresses of all my mail mates (those to
whom I sent and got letters from) with the help of Outlook or by programming
it?

Thanks in advance
 
G

Gordon

vocsok said:
Hi

I've taken home the pst file containing the copy of my mails from my
workplace and I would like to let to know all my mail mates about my new
email address.
My question: how can I get the mail addresses of all my mail mates (those
to
whom I sent and got letters from) with the help of Outlook or by
programming
it?

Thanks in advance


Firstly are you entitled to take these emails away from your workplace?
Secondly, just open the file in Outlook.
 
V

vocsok

(The question is valid, at a first glance, but the fact is, these are
personal emails, separated into different folder, so I could delete others.
The aim is to send a notice the remaining emails, about mailing is no longer
allowed from that email adress of my firm.)

My problem is that I have hundreds of emails with different addresses, not
included in my contact, and I want to write to all of them at once. How can I
do it without having to put each address in the contacts manually?
 
G

Gordon

vocsok said:
(The question is valid, at a first glance, but the fact is, these are
personal emails,

hmmm. Using company software and bandwidth for /personal/ emails? ;-)


separated into different folder, so I could delete others.
The aim is to send a notice the remaining emails, about mailing is no
longer
allowed from that email adress of my firm.)

My problem is that I have hundreds of emails with different addresses, not
included in my contact, and I want to write to all of them at once. How
can I
do it without having to put each address in the contacts manually?


Nothing without third-party software.
See if anything here helps:
http://www.slipstick.com/contacts/addauto.asp
 
V

vocsok

Yes, thanks, the link was usefull, it leads me to this page:
http://www.outlookcode.com/d/code/autoaddrecip.htm#info
where I found that code, what I modified (really, I dont know the VBA) with
hand of MSOutlook 2007 Help this way:

Sub Kigyujtes()

Set myOlApp = Outlook.Application
Set myNamespace = myOlApp.GetNamespace("MAPI")
Set myfolder = myNamespace.GetDefaultFolder(olFolderInbox)
For Each levelek In myfolder.Items
Call Application_ItemSend(levelek, False)

Next
End Sub

' sample Outlook 2003 VBA application by Sue Mosher
' send questions/comments to (e-mail address removed)

' The Application_ItemSend procedure must go in the
' built-in ThisOutlookSession session module in Outlook VBA
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
If Item.Class = olMail Then
Call AddRecipToContacts(Item)
End If
Set Item = Nothing
End Sub
Sub AddRecipToContacts(objMail As Outlook.MailItem)
Dim strFind As String
Dim strAddress As String
Dim objNS As Outlook.NameSpace
Dim colContacts As Outlook.Items
Dim objContact As Outlook.ContactItem
Dim objRecip As Outlook.Recipient
Dim i As Integer
On Error Resume Next

' get Contacts folder and its Items collection
Set objNS = Application.GetNamespace("MAPI")
Set colContacts = objNS.GetDefaultFolder(olFolderContacts).Items

' process message recipients
For Each objRecip In objMail.Recipients
' check to see if the recip is already in Contacts
strAddress = AddQuote(objRecip.Address)
For i = 1 To 3
strFind = "[Email" & i & "Address] = " & _
strAddress
Set objContact = colContacts.Find(strFind)
If Not objContact Is Nothing Then
Exit For
End If
Next

' if not, add it
If objContact Is Nothing Then
Set objContact = _
Application.CreateItem(olContactItem)
With objContact
.FullName = objRecip.Name
.Email1Address = strAddress
.Save
End With
End If
Set objContact = Nothing
Next

Set objNS = Nothing
Set objContact = Nothing
Set colContacts = Nothing
End Sub

' helper function - put in any module
Function AddQuote(MyText) As String
AddQuote = Chr(34) & MyText & Chr(34)
End Function


The only problem is, this works on "Inbox", and gets recipients only. And
I'd like to get senders as well, from all directories.
(Additionally I realized, that items had got this way appear in "Contacts"
reachable via left side panel, but in via Menu (Tools\...\Contacts) space.
???)
 
B

Brian Tillman [MVP - Outlook]

The only problem is, this works on "Inbox", and gets recipients only. And
I'd like to get senders as well, from all directories.
(Additionally I realized, that items had got this way appear in "Contacts"
reachable via left side panel, but in via Menu (Tools\...\Contacts) space.
???)

microsoft.public.outlook.program_vba may be a good place to discuss the
programming. There are also third-party tools you can buy that will look
through messages and pull out addresses. See this:
http://www.slipstick.com/addins/contacts_entry.asp
 

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