PC Review


Reply
Thread Tools Rate Thread

Display Contacts

 
 
ttempl
Guest
Posts: n/a
 
      14th Jul 2008
My vb.net app currently has a button for Outlook Contacts that sets focus to
Outlook, specifically the Contacts tab. Can I programmatically set focus to a
specific address book on the Contacts tab? I know I could physically set each
workstation using the "Show this address book first". But, the users could
change that. So, can I set focus to the correct address book from my app?
For example, my company has a global address list with all employees in it,
and I want to set focus to that address book instead of the user's personal
address book.

Current code

Dim olApp As Outlook.Application
Dim oNS As Outlook.NameSpace

olApp = CreateObject("Outlook.Application")
oNS = olApp.GetNamespace("MAPI")
If olApp.ActiveWindow Is Nothing Then

oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts).Display()
Else
oNS.Application.ActiveExplorer.CurrentFolder =
oNS.Application.ActiveExplorer.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts)
End If
oNS.Application.ActiveExplorer.WindowState =
Outlook.OlWindowState.olNormalWindow
oNS.Application.ActiveExplorer.Left = 215
oNS.Application.ActiveExplorer.Top = 87
oNS.Application.ActiveExplorer.Width = 800
oNS.Application.ActiveExplorer.Height = 627
oNS.Application.ActiveExplorer.Activate()
olApp = Nothing
 
Reply With Quote
 
 
 
 
Brian Tillman
Guest
Posts: n/a
 
      14th Jul 2008
ttempl <(E-Mail Removed)> wrote:

> My vb.net app currently has a button for Outlook Contacts that sets
> focus to Outlook, specifically the Contacts tab.


microsoft.public.outlook.program_vba is the correct newsgroup for
programming issues.
--
Brian Tillman [MVP-Outlook]

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Contacts display as TLucas Microsoft Outlook Contacts 9 28th Dec 2009 08:46 PM
Contacts display in TO: field, but don't show up in Contacts =?Utf-8?B?TGluZHNheUc=?= Microsoft Outlook Contacts 3 4th Jul 2007 11:41 AM
send email to multiple contacts, but not display other contacts in to field tim Microsoft Outlook 1 31st Jan 2007 10:19 PM
How to get public contacts folder(s) to display under "My Contacts =?Utf-8?B?QXZhIEhlYWx5?= Microsoft Outlook Discussion 1 11th Feb 2006 09:49 PM
Contacts do not display name at the top in Contacts folder Norman McFarlane Microsoft Outlook Contacts 2 4th Feb 2005 03:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:24 PM.