Open another pst file

Joined
Mar 27, 2006
Messages
4
Reaction score
0
guys, can u gve me a program that can open another pst file that has been inputed by a user in a textbox....
heres a sample 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
' VBA code example.


Set olNS = ol.GetNamespace("MAPI")

' Set MyFolder to the default contacts folder.
Set myFolder = olNS.GetDefaultFolder(olFolderContacts)

' Set MyItems to the collection of items in the folder.
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