Exchange / Outlook Public Folder access in vb.net

C

Chris Thunell

Help!

We keep all our contacts in a public folder called "Company Contacts", I am
writing a windows forms vb.net application, where i would like to find a
contact from that public folder, and get some information from it like,
"Full Name", "Business Fax" etc etc.

Right now i have an Outlook View Control on the form (I believe it is an
activeX control) and I am finding it hard to get the view to work for me. I
can actually view the contact list, but I cannot format what fields to show
etc etc.

Basically, i'm looking for a way for a user to be able to find a contact
easily from the Exchange Public folder.... any ideas? Any direction on how
to manipulate the Outlook View control?
Any ideas / resources / direction would be GREATLY appreciated!

Chris Thunell
(e-mail address removed)
 
P

Peter Huang

Hi Chris,

Hi

You may try to see the ViewXML property of the control.

Here is the Documentation of Outlook View Control.
Outlook 2002 Documentation: Microsoft Outlook View Control Reference
http://www.microsoft.com/downloads/details.aspx?FamilyId=831F957F-3190-48DA-
A099-2BDBC7397623&displaylang=en

Here I output the xml file as a template from outlook.
Sub test()
Dim fd As MAPIFolder
Set fd = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts)
Dim fso As New FileSystemObject
Dim f As TextStream
Set f = fso.CreateTextFile("c:\test.xml")
f.Write (fd.CurrentView.XML)
f.Close
End Sub

make some change to the xml file and import it into the VB.NET
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
AxViewCtl1.Folder = "contacts"
Dim sr As StreamReader = New StreamReader("c:\test.xml")
Dim str As String
str = sr.ReadToEnd()
AxViewCtl1.ViewXML = str
End Sub

[NOTE: I did not test all the fields of Contacts in my test code]
Here is some helpful links, you may have a check.
http://www.slipstick.com/dev/formcontrols.htm#ovc
http://gethelp.devx.com/techtips/thevbpro/10_minute_solutions/10min1099.asp

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
 

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