4

I'm developing an add-in in c# for outlook's 2007 and 2010.

Lets say I have Outlook.MailItem object of currently displayed mail and I want to replace part of the mail text with buttons, that would call an internal add-in function (passing some parameters of course). Is that even possible to make that callback to add-in function? If yes then could you guys put me on the right track, because I can't seem to find anything related to this.

SliverNinja - MSFT
  • 31,051
  • 11
  • 110
  • 173
  • 1
    Would having a "region" with buttons be sufficient for your use case? That would mean that there is a bar at the top/bottom of the message that contains the buttons. – GTG Oct 09 '12 at 13:49
  • Well it wouldn't be that much user intuitive that I'd like, but if there isn't a proper solution to this, I'l probably make something like this or I make a custom protocol:// with software that handles it, and then insert href's into mail body with appropriate links. – Vytautas Klumbys Oct 10 '12 at 08:00
  • @VytautasKlumbys, I came across somewhat the same requirement. Do you get any solution for this? – Ank Raw Mar 28 '21 at 04:12

1 Answers1

1

To my knowledge, you cannot add buttons to the MailItem.Body. The best you could do is add items to the Ribbon UI based upon the message body's content. There are also similar methods using custom Task Panes and Form Regions.

You can try working with the Word Editor directly, but I have not tried that path.

Outlook.Inspector inspector = Globals.ThisAddIn.Application.ActiveInspector();
Word.Document document = (Word.Document)inspector.WordEditor;
Community
  • 1
  • 1
SliverNinja - MSFT
  • 31,051
  • 11
  • 110
  • 173