View Single Post
  #3  
Old February 21st 07, 12:12 AM posted to microsoft.public.outlook.program_vba
Oliver Burkhardt
external usenet poster
 
Posts: 4
Default How to access over VBA in Outlook 2003 contacts in other Datafiles?

Thank you very much Michael!

So I wrote this code:
It works, but how do I select the contact folder in the dasistes Folder?

Thanks a lot.

Public Sub test()
Dim toplevelfolder As Object
Dim dasistes As Object
Dim myNamespace As Outlook.NameSpace

For Each toplevelfolder In Application.Session.Folders
'MsgBox toplevelfolder.Name
If InStr(1, toplevelfolder.Name, "form", vbTextCompare) Then

Set dasistes = toplevelfolder
MsgBox "JETZT"
End If


Next toplevelfolder

MsgBox dasistes.Name

'MsgBox dasistes.Name
End Sub



"Michael Bauer [MVP - Outlook]" schrieb im Newsbeitrag
...


Oli, you can simply walk through the folder hierarchy.
Application.Session.Folders gives you all opened, visible top folders.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Keep your Outlook categories organized!
http://www.shareit.com/product.html?...4&languageid=1
(German: http://www.VBOffice.net/product.html?pub=6)

Am Tue, 20 Feb 2007 12:40:22 +0100 schrieb Oliver Burkhardt:

Hi!

I know how to access via VBA the contacts in the 'Personal Folder'.

But if I open a new Datafile, I don't know to access the contacts there?

Who could help me?
Thx a lot.

Greets, Oli



Ads