1
votes

Is it possible to create an Excel document using VSTO, using a SharePoint contenttype?

Creating a document in VSTO based on a template is easy.

Workbook newWorkbook = this.Application.Workbooks.Add(@"C:\temp\TestTemplate.xltx");

But the "template" that's assigned to a content type in SharePoint has xlsx as an extension.

1

1 Answers

1
votes

The xlsx extension is not because the file is hosted in SharePoint, but because it is an Office 2007 template (all office 2007 extensions have an extra x behind their extension, so .doc becomes .docx). You can assign your own templates to content types in SharePoint if you want.

VSTO should work with xlsx files too, you probably just need to use the office 2007 dll's.