I have written VSTO addins for Office 2013 (and later) apps that integrates them with a 3rd-party enterprise content management (ECM) system - providing the user with ECM analogs for all of the native file I/O operations (e.g. New
, Save As
, etc...). That said, all of the functions proved quite simple to implement until I got to the New
function (i.e. the ability to create a new document (Word, PowerPoint or Excel) from a supplied template. In Word, this was simple:
Voila! The user selects a Word template file (i.e. filename) and Word subsequently creates a Word document based on the selected template file. Naively, I thought the PowerPoint and Excel object models would be similar to Word's - I was wrong. There doesn't appear to be any method similar to Add
) that performs the same
function. While I did find examples on the web of creating a PowerPoint document from a specified template file, the approach taken was radically different than that required by Word, involved using the Open XML SDK
and was significantly more convoluted.
Does anyone know of a simpler way (in C#) of creating both Excel and PowerPoint documents from specified template files (i.e. .xltx
files)? I look forward to everyone's feedback!