Hello experts,
I am trying to attached a template (.dot file) using the following code below in C#, but its not working as expected.
if (Doc != null && sTemplateFile != "")
{
object CustomizationContext = sTemplateFile;
Doc.set_AttachedTemplate(ref CustomizationContext);
}
_WordApp.Activate();
_WordApp = null; // get rid of our reference as Word itself is now open and the user
// will close manually
why I am importing the template:
================================
There are some "custom built menus" in the template file which I want to be imported to the new word document, whenever this template file is attached to it. So that whenever user creates a new word document, it aleady has the custom built menus (that would come from the template file, if it had attached succeffully .. but its not!).
The problem is:
===============
It does not attach the template file and new menus dont appear!
Any help would be great
Thanks
I am trying to attached a template (.dot file) using the following code below in C#, but its not working as expected.
if (Doc != null && sTemplateFile != "")
{
object CustomizationContext = sTemplateFile;
Doc.set_AttachedTemplate(ref CustomizationContext);
}
_WordApp.Activate();
_WordApp = null; // get rid of our reference as Word itself is now open and the user
// will close manually
why I am importing the template:
================================
There are some "custom built menus" in the template file which I want to be imported to the new word document, whenever this template file is attached to it. So that whenever user creates a new word document, it aleady has the custom built menus (that would come from the template file, if it had attached succeffully .. but its not!).
The problem is:
===============
It does not attach the template file and new menus dont appear!
Any help would be great
Thanks