1
votes

We are in the middle of upgrading our VSTO (VS2010) templates from office 2010 to office 2016 using VS2015.

The templates have already been converted once using VS2015 by someone who has left the company but trying to get these working again to update phone numbers etc. in our DEV server environment has been just error after error.

So I thought doing a clean project from scratch in VS2015 re-using the names, Assembly names, Assembly information inc GUID and code of the original templates so that it is a more clean office 2016 project with the original functionality.

These new templates work fine when creating a new document or editing that new document. The problem comes with documents created with the original 2010 templates.

Lets say you have installed the new clean office 2016 "Letter" template and then open a document created using the equivalent office 2010 "Letter" template. Rather than assuming the new template is the same as the old template (as it used to do with the converted template) it trys to re-install the office 2010.

How can I get the new template to link to documents created with the old ones if that makes sense?

Many thanks,

Dean

making sure the project names, Assembly names, Assembly information inc GUID are the same as the original template and the version number is higher than the old template.

1
You can change the template from the Developer tab. you have to turn it on first under 'Customize the Ribbon'. I can't tell if this is what you're asking though.Chris
Hi Chris, I don't think its viable to change every document we have from its old template path to the new one. Maybe I wasn't clear enough with my original question. So as I said that someone else converted the old templates to office 2016 and deployed them. These templates when installed on a PC work fine and when old 2010 docs are opened they open with these installed converted templates instead of trying to find the old template. That's the behavior I'm looking for with these new templates. ThanksDeanW5000
So you have the old template installed in one folder, and the new one installed in another folder? Is that right? Because otherwise I would expect all documents to open the same way.Chris
Yep that's correct as we still have some users that are still win7 office 2010 using them (slowly getting migrated). Plus someone unwisely named the network share folder "Office 2007 Templates". The New folder share is called just "Office Templates".DeanW5000

1 Answers

0
votes

Having them in 2 places is the problem, the old documents have links to the folder from which they were installed. You could change the template as I previously described on the Developer tab (and maybe also the update location under File > Info > Properties > Advanced Properties > Custom > _AssemblyLocation), or do so programmatically but since you can't get the old one to build you can't add the code to do it.

But since you are re-using the same project details you should be able to just drop the new one on top of the old one (I believe SolutionID is the property you need to be most concerned with, but that's probably what you meant by GUID). And then you could potentially update those values programmatically to point to the folder with a better name.