Newbie - Help (very simple i hope)

  • Thread starter Thread starter peterr
  • Start date Start date
P

peterr

Hi,
I have added a toolbar button onto the outlook explorer toolbar and
when the user clicks it I want to be able to display the currently
seleceted/highlighted text (from an email say) in a message box.

Simple eh!

Any ideas
 
Very simple. For VB.NET, try this in your button's event handler. (olApp is an Outlook.Application object):

If olApp.ActiveExplorer.Selection.Count > 0 Then
MessageBox.Show(olApp.ActiveExplorer.Selection.Item(1).Body)
End If
 
C# Currently Selected Item

In case anyone else is looking. Here is how you do it in C#.
This is for a ContactItem. I have not tried it on any other item types.

ContactItem ci = (ContactItem)applicationObject.ActiveExplorer().Selection[1];
 
Back
Top