0

I am attempting to call code in a VSTO add-in.

The first place I landed in my searches was MS Walkthrough Calling Code in an Application Level Add-in

  1. I made a new VSTO project for Outlook.
  2. In this project I created the following Note Attributes same as in Walkthrough and added the RequestComAddInAutomationService

    enter image description here

  3. I then created a WPF application project and added my VSTO addin as a reference.

  4. The following is what happens. Please note that if I simply use the addin Object I can call my code, but I am unable to cast the interface. enter image description here

The first thing I have noticed is that This blog uses different attributes.

For anyone landing here and looking for a similar question in C# there are lots, this one being very similar however seems very user / computer specific.

So could anyone please help me to understand why I cannot cast the interface?

Community
  • 1
  • 1
darbid
  • 2,545
  • 23
  • 55

1 Answers1

0

The problem is that the Interface was not registering properly for COM. Once the registration is done properly then the cast worked.

darbid
  • 2,545
  • 23
  • 55