The default behavior to click and open a ".dot" file

I developed a word template, mytemplate.dot, using VSTO. When an user clicks the "mytemplate.dot" file, I see two different behaviors on different machines:

1: The word starts with "document1.doc" as the default word document name.

2: The word starts with "mytemplate.dot" and tries to update the template.

The second behavior is not what I want. How to avoid the second one progrmatically with VSTO

Thanks,

Yuhang.



Answer this question

The default behavior to click and open a ".dot" file

  • yinpengxiang

    You can't change the second behavior, as this is a problem with the profile's Windows configuration. To see what I mean, right-click a *.dot file in Windows explorer. When things are configured according to the installation default, NEW should be bold (the default action). On the machine in question, the OPEN action has been set to the default for the *.dot file type.

    What you should be able to do in your solution, however, is test whether the current document (this.InnerObject.Type - Type is a member of wdDocumentType enum) is a document or a template and take appropriate action (close the file immediately, for example).



  • anubisascends

    that works very well!

    Thanks,


  • The default behavior to click and open a ".dot" file