Calling existing Macros from A Word 2010 Template into VSTO 2010

Posted on 2012-09-20
Last Modified: 2013-11-10
Hi all,

I have created a custom ribbon tab using the ribbon editor function in VS 2010. I am able to run the tab and all the buttons display the content desired. I am left to now code the macros from the existing modules into the buttons. I can not figure out how to do this. For an example.
 In the ribbon designer
Button 1 is a Watermarks button called button1
I need this to generate a watermark by running the macro within the Word .dotm, Module is Watermarks and the SUB is WMCONFIDENTIAL.

Please assist. Thank you!

Question by:BEKSUPPORT
    LVL 35

    Accepted Solution

    On the button1 event handler, addthe following code:

    Open in new window

    For more info check:

    Author Comment

    Hi mas_oz2003,

    I will give this a shot. Thank you.


    Author Comment

    Hi mas_oz2003,

    Thank you so much, it worked beautifully. I just needed to change the ThisDoc to ThisAddIn. Thanks again!


    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Suggested Solutions

    A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
    Microsoft Word is a program we have all encountered at some point, but very few of us have dug deep into its full scope of features, let alone customized it to suit our needs. Luckily making the ribbon (aka toolbar, first introduced in Word 2007) wo…
    In this video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …
    This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now