Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Weary Traveler Needs Assistance: Change Focus to Outlook Contacts

I'm trying to give the user a button to push in a spreadsheet to simply
change focus to Outlook Contacts. Everything seems to work except the
very last command - the one to change focus. What am I missing?

Here's what I've got so far:

Dim ObjOutlook As Outlook.Application
Dim bWasntRunning As Boolean

bWasntRunning = False

On Error Resume Next
' Try first to use an existing instance.

Set ObjOutlook = GetObject(, "Outlook.Application")

If Err Then ' Outlook isn't running, so start it.
bWasntRunning = True
Set ObjOutlook = CreateObject("Outlook.Application")
End If

Set objnamespace = ObjOutlook.GetNamespace("MAPI")

Set objFolder = objnamespace.GetDefaultFolder(olFolderContacts) ' This
stmt does set objFolder to "Contacts"

objFolder.Display 'This creates a new instance of Outlook
'regardless of whether one is already
'open or not. Take this out, and I get no
'change of focus to Outlook Contacts.

Any help would be greatly appreciated. Thanks!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing Excel database into Outlook Contacts says "No Named Rang Bryan Excel Discussion (Misc queries) 13 December 17th 09 10:23 PM
Can I connect data from Outlook contacts to cells within Excell? Sean T. Newton Excel Worksheet Functions 0 August 8th 05 08:25 PM
How do i export excel data to outlook contacts Joshna Excel Discussion (Misc queries) 1 July 13th 05 03:01 PM
Excell linked to outlook contacts Tofolo Excel Worksheet Functions 1 June 23rd 05 07:38 PM
Using excel to modify a CSV for internatilising outlook contacts Jon Excel Discussion (Misc queries) 1 June 1st 05 08:05 PM


All times are GMT +1. The time now is 01:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"