SINGLE FILE WORD ADDIN CONTAINING REQUISITE TEMPLATE SECTIONS
-
Saturday, June 30, 2012 8:00 PM
Is there anyway to have a document template placed inside a Word AddIn?
An example is as follows:
There are 3 Buttons on a Custom Ribbon Tab presented by a Word AddIn designed inside VS2010.
Upon Clicking Button_1, Button_2 or Button_3, I need the AddIn to present the relevant Section {i.e. Sections(1), Section(2) or Sections(3) respectively} of a template be presented on a new Word Document.
I need a whole document template with three different Sections inside the Word Addin itself, so that all I need to distribute amongst the users a Single AddIn file instead of including an additional template file to select the relevant section therefrom.
Thanx in advance.
Best Regards, Faraz A Qureshi
All Replies
-
Tuesday, July 03, 2012 6:09 AM
I'm not sure what you mean by inside a Word Addin. But you can write code in your button click event to generate things you want once the button is clicked.
Hope it helps.
Regards,
Fermin -
Wednesday, July 04, 2012 7:06 AMModerator
Hi Faraz
A Word Add-in, created using the VSTO technology, is a set of files that are distributed and installed on the client machine. So a Word Add-in is, itself, not a single file AND just about anything can be distributed as part of the Add-in "Solution".
So it would be quite possible for you to distribute a Word template (*.dotx, *.dotm or *.dot file) as part of the Add-in. This template could contain Building Blocks that hold the various alternate content you'd like to access. On clicking a button in the Add-in, a particular Building Block entry could be inserted from the template (which the Add-in would first need to load).
If you're not referring to a VSTO add-in, but instead a Word template add-in, then the approach would be the same: store the content as Building blocks in the Add-in template and insert a building block as required.
Cindy Meister, VSTO/Word MVP
- Proposed As Answer by Quist ZhangMicrosoft Contingent Staff, Moderator Wednesday, July 04, 2012 12:21 PM
- Marked As Answer by Quist ZhangMicrosoft Contingent Staff, Moderator Monday, July 09, 2012 2:51 AM

