can't get .Selection.Count to return anything other than 0

G

Gordon Prince, MCP

I can't get the following to work. I've looked at the online help as well as the newsgroup history and it appears other people are using this. What am I doing wrong?


--------------------------------------------------------------------------------

Set olExplorer = olContactsFolder.GetExplorer(OlFolderDisplayMode.olFolderDisplayNoNavigation)
With olExplorer
.CurrentView = strViewName
If .Selection.Count = 0 Then
.Close
Else
.Activate
End If
End With
 
D

Dmitry Streblechenko \(MVP\)

Use Application.ActiveExplorer instead of MAPIFolder.GetExplorer.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

I can't get the following to work. I've looked at the online help as well as
the newsgroup history and it appears other people are using this. What am I
doing wrong?




Set olExplorer =
olContactsFolder.GetExplorer(OlFolderDisplayMode.olFolderDisplayNoNavigation
)
With olExplorer
.CurrentView = strViewName
If .Selection.Count = 0 Then
.Close
Else
.Activate
End If
End With



The .Selection.Count is always 0. The window is displayed with one or two
items in it. I've tried activating, then checking the .Count -- no
difference.

Any suggestions?
 
Top