How to open another pst file not using MAPI but a specified pst

Joined
Mar 27, 2006
Messages
4
Reaction score
0
guys can u help me.. how can i open a pst file using vb6 if i have a pst file named zee.pst or cmz.pst and it is in c:/zee.pst or c:/ my documents/cmz..
MAPI is a defualt pst right.. what if i want to change the path. coz i want to want to view the names and addresses.. thank you guys...
MAPI = outlook.pst

heres my code:

Private Sub Getnameaddress()
Dim ol As New Outlook.Application
Dim olNS As Outlook.NameSpace
Dim myFolder As Outlook.MAPIFolder
Dim myItems As Outlook.Items
grd.Rows = 2
Set olNS = ol.GetNamespace("MAPI")
Set myFolder = olNS.GetDefaultFolder(olFolderContacts)
Set myItems = myFolder.Items
For Each SpecificItem In myItems
grd.TextMatrix(grd.Rows - 1, 0) = SpecificItem.FullName
grd.TextMatrix(grd.Rows - 1, 1) = SpecificItem.Email1Address
grd.Rows = grd.Rows + 1
Next
End Sub
 

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