PC Review


Reply
Thread Tools Rate Thread

How to determine a selected contact

 
 
Darren H Gill
Guest
Posts: n/a
 
      21st Jul 2005
Hi,

I am trying to automate Outlook from Access VBA so that I can open a public
folder and select a contact from it.

My application needs to be able to read information from the public folder
ContactItem object.

I have trid to bind an explorer object declared as
Private WithEvents OutlookExplorer As Outlook.Explorer

I display the explorer from a class method:

Dim oFolder As Outlook.MAPIFolder
Set oFolder = GetOutlookFolderFromID(CStr(FolderID))
Set OutlookExplorer = oFolder.GetExplorer(olFolderDisplayNoNavigation)
Call OutlookExplorer.ShowPane(olFolderList, False)
Call OutlookExplorer.ShowPane(olPreview, False)
Call OutlookExplorer.ShowPane(olPreview, False)


OutlookExplorer.Activate


What I then tried to do was read the Explorer Selection collection in the
SelectionChanged event.

Private Sub OutlookExplorer_SelectionChange()
Debug.Print "SElection Changed ..."
If OutlookExplorer.Selection.Count Then
'Process the selected contacts
End If
End Sub


However, My problem seems to be that the event does not fire! Am I missing
something fundamental here?

Thanks,

Darren Gill


 
Reply With Quote
 
 
 
 
Michael Bauer
Guest
Posts: n/a
 
      22nd Jul 2005
Hi Darren,

assuming GetOutlookFolderFromID returns the correct folder, did you
check if the class terminates after executing the shown code?

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook



Darren H Gill wrote:
> Hi,
>
> I am trying to automate Outlook from Access VBA so that I can open a
> public folder and select a contact from it.
>
> My application needs to be able to read information from the public
> folder ContactItem object.
>
> I have trid to bind an explorer object declared as
> Private WithEvents OutlookExplorer As Outlook.Explorer
>
> I display the explorer from a class method:
>
> Dim oFolder As Outlook.MAPIFolder
> Set oFolder = GetOutlookFolderFromID(CStr(FolderID))
> Set OutlookExplorer =
> oFolder.GetExplorer(olFolderDisplayNoNavigation) Call
> OutlookExplorer.ShowPane(olFolderList, False) Call
> OutlookExplorer.ShowPane(olPreview, False) Call
> OutlookExplorer.ShowPane(olPreview, False)
>
>
> OutlookExplorer.Activate
>
>
> What I then tried to do was read the Explorer Selection collection in
> the SelectionChanged event.
>
> Private Sub OutlookExplorer_SelectionChange()
> Debug.Print "SElection Changed ..."
> If OutlookExplorer.Selection.Count Then
> 'Process the selected contacts
> End If
> End Sub
>
>
> However, My problem seems to be that the event does not fire! Am I
> missing something fundamental here?
>
> Thanks,
>
> Darren Gill


 
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
Determine what row is currently selected =?Utf-8?B?RGFsZSBGeWU=?= Microsoft Excel Programming 2 17th Aug 2007 02:24 AM
RE: Determine what row is currently selected =?Utf-8?B?Sm9lbA==?= Microsoft Excel Programming 2 17th Aug 2007 02:06 AM
RE: Determine what row is currently selected =?Utf-8?B?RGFsZSBGeWU=?= Microsoft Excel Programming 0 17th Aug 2007 01:59 AM
Determine which button was selected ?? =?Utf-8?B?ZGNhcnI=?= Microsoft Excel Programming 4 27th Oct 2004 11:02 PM
Determine Selected Cells John Tripp Microsoft Excel Programming 2 31st Jul 2003 02:48 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:46 AM.