Right Click

Add-in Express™ Support Service
That's what is more important than anything else

Right Click
 
SSL




Posts: 178
Joined: 2014-01-05
If I right click TO or CC in email preview, which context menu is it that is shown, it contains "Cut, Copy, Paste, Clear, Select All, Add to favorites, Add to Outlook Contacts, Open Outlook Properties and Open Outlook Contact Card"
Posted 07 Jul, 2015 09:03:18 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
Hello Tom,

Install the add-in described at https://www.add-in-express.com/creating-addins-blog/2015/04/15/creating-office-context-menu-addin/. If that context menu is customizable, the add-in will add a button to the context menu; the button caption is the context menu name.


Andrei Smolin
Add-in Express Team Leader
Posted 08 Jul, 2015 06:50:30 Top
SSL




Posts: 178
Joined: 2014-01-05
Thanks Andrei,

That's exactly what I was looking for, can you point me in the right direction, With the right click option, I am trying to return the email address of what ever email address I right click on now, in email preview.

If I right click on a senders email address or right click on a recipients email address (how can I tell which is which in order to return it)

Regards,
Tom
Posted 09 Jul, 2015 05:10:31 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
Mmm, I think I've pointed you to the right direction. Did you install the add-in? Does it add an item to that context menu?


Andrei Smolin
Add-in Express Team Leader
Posted 09 Jul, 2015 06:34:30 Top
SSL




Posts: 178
Joined: 2014-01-05
Hi Andrei,

Yep I can get my buttons to appear, I just need the smtp address of the item I right click on, I found something for VSTO and was looking for the AddinExpress Equivalent.


 Public Sub GetContextmenuContactCard()
        If TypeOf Control.Context Is Microsoft.Office.Core.IMsoContactCard Then
            msg = "Context=IMsoContactCard" + vbLf
            Dim card As Office.IMsoContactCard = TryCast(Control.Context, Office.IMsoContactCard)
            Dim addr As Outlook.AddressEntry = Globals.ThisAddIn.Application.Session.GetAddressEntryFromID(card.Address)
            If addr IsNot Nothing Then
                msg = msg + addr.Name
            End If
            MessageBox.Show(msg)
        End If
    End Sub
Posted 20 Jul, 2015 07:59:43 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
Hello Tom,

The Click event of the button provides the parameter of the IRibbonControl type. You get context by calling IRibbonControl.Context. You replace Globals.ThisAddIn.Application with MyAddin1.AddinModule.CurrentInstance.OutlookApp.


Andrei Smolin
Add-in Express Team Leader
Posted 20 Jul, 2015 08:28:40 Top
SSL




Posts: 178
Joined: 2014-01-05
Hi Andrei,

Not able to get the desired result, have you any examples? My Addin is outlook 2007 onwards specific.

Regards,

Tom
Posted 20 Jul, 2015 10:21:35 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
Tom,

You can find a code sample in section Determining a ribbon control's context at https://www.add-in-express.com/docs/net-ribbon-components.php; convert the code to VB.NET using any C# to VB.NET converter available on the web.

If the above doesn't help, please show your code and specify what exactly doesn't work (and in what way).


Andrei Smolin
Add-in Express Team Leader
Posted 21 Jul, 2015 03:39:17 Top
SSL




Posts: 178
Joined: 2014-01-05
Hi Andrei,

I think we might be talking about different things here.

What I have done up till now is I have added a button to (IDMSO:ContextMenuContactCardRecipient) and my button displays if I right click on (Within the email preview) any email address (sender, recipient, CC etc)

I am unsure how to return whichever email address I have selected (I want to pass this email address to somewhere else).

I think what I am trying to do is get the selected contact card recipients email address.

Regards,

Tom
Posted 21 Jul, 2015 06:48:49 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
Tom,

I assumed you were talking about a problem of modifying a VSTO sample code so that it works in Add-in Express. Do you use the code you posted a while back with modifications I suggested?


Andrei Smolin
Add-in Express Team Leader
Posted 21 Jul, 2015 07:13:29 Top