Menu Item Add

R

rkl

I am not new to programming but I am new to the outlook object model
and am looking for some help.

I found an article that let me create a COM add-in and all that worked.
The two additional items I am looking for are:

1. What would I need to do in order to add an item to the right-click
menu when I have an email hilighted?

2. What object/method/property would I need to use in order to get the
body of an email and store that in a variable in my code?

Any help is greatly appreciated.

Thanks.
 
S

Sue Mosher [MVP-Outlook]

1) Outlook does not directly expose the right-click context menu in its CommandBars collection. You will, however, see a new right-click command is when the item selected is using a custom form that includes one or more custom actions. You can also add a custom action without using a custom form, as demonstrated at http://www.outlookcode.com/codedetail.aspx?id=526

Richard Kagerer has posted a code sample at http://www.outlookcode.com/codedetail.aspx?id=314 that shows how you might trick Outlook into exposing the context menu through Explorer.CommandBars.

The C++ sample add-in at http://www.codeproject.com/atl/outlook2k3addin.asp also shows a technique for working with the context menu.

2) Body or HTMLBody. When in doubt, check the object browser: Press ALt+F11 to open the VBA environment in Outlook, then press F2. Switch from <All Libraries> to Outlook to browse all Outlook objects and their properties, methods, and events. Select any object or member, then press F1 to see its Help topic.
 
R

rkl

Thanks Sue

I think I have most of what I need but one more thing.

What I need to do is identify the parts of the currently selected email
and I am not finding how to do that. Basically I want to store the
text of the email in a var but I first need to know how to reference
the currently selected email.

Thanks.
 
S

Sue Mosher [MVP-Outlook]

The item(s) -- note plural -- that are currently selected are represented by the Application.ActiveExplorer.Selection collection.
 

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