pnp

Hi

We have an issue that we can't seem to figure out. If we have a VSTO enhanced word template and we create a new document based upon this template - then whenever you save your document then Word asks us if we want to save the template as well. For most people in the company the template file is read-only which makes them unable to say yes (a save file dialog will appear), for the rest it's annoying since we don't want to update the template.

Does anyone have any suggestions to why this is occuring As I see it, there should be no reason to make changes to the template. If the current manifests have changed - then just change that in the document created. And as I see it, the manifest information is the only part in the template that VSTO should change.

I hope somebody out there can help us clarify this.

Best regards
Anders


Re: Visual Studio Tools for Office Template changes when creating new document?

Cindy Meister

Hi Anders

Various things can cause Word to think a template is "dirty". Usually, the best way to avoid what you're seeing is to tell Word all changes have already been saved. In the case of a VSTO template, that would be something like:

this.AttachedTemplate.Saved = true;

Often, I have this at the end of the ThisDocument_Startup method, for example.






Re: Visual Studio Tools for Office Template changes when creating new document?

pnp

Thanks - we'll try that.

That sound like a nice workaround, though it gives me no explanation on why this occurs... But anyway, the most important thing is to ensure our users aren't annoyed by this popup always.

/Anders