A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Selection Object of Outlook View Control



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 24th 06, 11:07 AM posted to microsoft.public.outlook.program_addins
[email protected]
external usenet poster
 
Posts: 13
Default Selection Object of Outlook View Control

Hi

We are using Outlook 2003 and above, VSTO and C# for developing an
Outlook add-in.

We are using the Outlook View Control to display messages from folders.

We wanted to process the items selected from outlook view control.For
the same we capture the "Selection_Change" event of the view control
and tried to access the "Selection" object in the event handler.

We did reach the event handler but we are not able get anything from
the "Selection" object.
i.e viewcontrol.Selection object has no appropriate properties exposed.

Can someone post a C# code snippet for getting items selected from the
outlook view control OR
Give some links/pointers on how to go about it?


Thanks & Regards
TT

Ads
  #2  
Old August 26th 06, 05:02 AM posted to microsoft.public.outlook.program_addins
Josh Einstein
external usenet poster
 
Posts: 57
Default Selection Object of Outlook View Control

You need to reference the Outlook PIA. Then cast the selection property to
type Microsoft.Office.Interop.Outlook.Selection such as:

using Outlook = Microsoft.Office.Interop.Outlook;
.....
Outlook.Selection currentSelection = viewCtl.Selection as Outlook.Selection;
if ( currentSelection != null && currentSelection.Count 0 )
{
Outlook.MailItem currentMailItem = currentSelection[0] as
Outlook.MailItem;
if ( currentMailItem != null )
{
// you've got a selected mail item!
}
}

--
Josh Einstein / Tablet PC MVP
Einstein Technologies, LLC
-----------------------------------------------------
Tablet Enhancements for Outlook 3.0 Now Available
Unleash the potential of Outlook on your Tablet PC, Origami, or UMPC.
Try it for 15 days - http://www.tabletoutlook.com/Go.ashx?id=ng


wrote in message
oups.com...
Hi

We are using Outlook 2003 and above, VSTO and C# for developing an
Outlook add-in.

We are using the Outlook View Control to display messages from folders.

We wanted to process the items selected from outlook view control.For
the same we capture the "Selection_Change" event of the view control
and tried to access the "Selection" object in the event handler.

We did reach the event handler but we are not able get anything from
the "Selection" object.
i.e viewcontrol.Selection object has no appropriate properties exposed.

Can someone post a C# code snippet for getting items selected from the
outlook view control OR
Give some links/pointers on how to go about it?


Thanks & Regards
TT



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to control which user is showing up in "Other Calendars" view Morten Rasmussen, MKR Outlook - Calandaring 0 June 14th 06 04:30 PM
Outlook view control and one process [email protected] Outlook and VBA 6 June 5th 06 09:21 AM
Outlook view control and one process [email protected] Outlook - General Queries 2 May 31st 06 05:59 PM
Outlook/Access 2003 - Outlook View Control on Form w/ Multiple Calendars scs Outlook - General Queries 5 April 6th 06 02:18 PM
Outlook View Control to Preview an E-mail Sanjay Singh Outlook and VBA 0 January 18th 06 08:46 PM


All times are GMT +1. The time now is 07:50 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.