locked
external PlugIn calls macro sub, how to call a c# method? RRS feed

  • Question

  • Hello there!

    I currently try to port our Word and Excel pluins from VBA to C#. There is something I can't seem to figure out:

    We have a second plugin installed, that does some personalisation of documents. when the Plugin is done personalisating it calls a macro sub called "execAfterBatch()". The old VBA just needed to implement this method and it would be called.

    Now where do I need to put this method in C#? Or is there even a way to see if this method is called? Can I observe the Word Application and invoke a method call when this certain method is fired?I have no idea how I can achieve this sort of thing without falling back to VBA.

    Regards Sebastian

    Monday, December 29, 2014 12:15 PM

Answers

  • Seems like I need to look into this direction
    Monday, December 29, 2014 12:34 PM
  • Thanks Eugene for your acknowledgement. I got it working after following the guide. Now my new Plugin solution simply contains of 2 parts:

    • a small Word Template where the execAfterBatch() Sub is declared (this calls thwe C# PlugIn code, I call it the "glue template")
    • the C# PlugIn DLL that has the transitioned Code of the old marco


    Monday, January 5, 2015 8:33 AM

All replies

  • Seems like I need to look into this direction
    Monday, December 29, 2014 12:34 PM
  • Hello Sebastian,

    Yes, you are on the right avenue.

    Monday, December 29, 2014 3:19 PM
  • Thanks Eugene for your acknowledgement. I got it working after following the guide. Now my new Plugin solution simply contains of 2 parts:

    • a small Word Template where the execAfterBatch() Sub is declared (this calls thwe C# PlugIn code, I call it the "glue template")
    • the C# PlugIn DLL that has the transitioned Code of the old marco


    Monday, January 5, 2015 8:33 AM