Newbie - Help (very simple i hope)

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
 
S

Sue Mosher [MVP-Outlook]

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
 
A

andrewbrown

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 ite
types.

ContactItem ci
(ContactItem)applicationObject.ActiveExplorer().Selection[1]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top