none
"file Normal.dot already exists"

    Question

  •  

    Hello

    I'm developing an add-in for word using VSTO.

     

    Problem is, that many times, after closing word, I get the following message:

     

    "the file Normal.dot already exists. Do you want to replace the existing file?"

     

    I tried looking for it on the net, but the only solutions I found were client-directed, therefore the main suggestion there was to uninstall the add-in dll's.

     

    How can I, as a developer, prevent this error from reoccuring?

     

    Thanks in advance.

    Nissim Trabelsy

    Thursday, July 17, 2008 7:39 AM

Answers

  •  Nissim Trabelsy wrote:

    The add-in is a part of document management web-based system which my company develops. The user can use the add-in in order to navigate in the system and open a document from there. For reasons I cannot specify, I need to original document to stay open as I open another document

    Then all you should need to do is use the Application.Documents.Open method to open the new document. This should open in the existing instance of the Word application. No need to start an additional instance.

    Thursday, July 24, 2008 2:53 PM
    Moderator

All replies

  •  

    Hi ,

    I suggest you to set the this.Application.CustomizationContext  to the project. Please check this thread http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1845446&SiteID=1 which Cindy Meister gives a answer

     

    The second way to avoid this is if you made some change to CommandBar you need to set the parameter of  Temporary of this.Application.ActiveDocument.CommandBars.Add  to true.

    Thanks

    Wednesday, July 23, 2008 2:35 AM
  • Hi NIssem

     Nissim Trabelsy wrote:

    I'm developing an add-in for word using VSTO.

     

    Problem is, that many times, after closing word, I get the following message:

     

    "the file Normal.dot already exists. Do you want to replace the existing file?"

     

    I tried looking for it on the net, but the only solutions I found were client-directed, therefore the main suggestion there was to uninstall the add-in dll's.

     

    How can I, as a developer, prevent this error from reoccuring?

    Are you seeing this when debugging, or after deployment on a machine other than your development machine?

     

    I'd expect to see (and do often see) this message when debugging an Add-in, with another instance of Word already open. Debug starts an independent instance,using the same Normal.dot. Since Word was not designed to be used in this manner, Word has a problem when the second instance wants to shut down and can't save settings that may have been changed.

     

    If you're seeing this when (you think) only one instance of Word is running, check the Task Manager whether there's another instance (perhaps from a crash, that wasn't able to shut down correctly) in memory.

     

    The reasons why Word would be trying to save to Normal.dot are as Tim has outlined. But under normal circumstances you shouldn't be seeing this particular message...

    Wednesday, July 23, 2008 9:05 AM
    Moderator
  • Hello Cindy, thanks for the response

     

    This may still be a problem, since some of my add-in's functions involves opening a new instances of word/excel (while the original is still open).

     

    Is there's anyway to bypass this problem?

     

    Wednesday, July 23, 2008 9:19 AM
  •  Nissim Trabelsy wrote:

    Hello Cindy, thanks for the response

     

    This may still be a problem, since some of my add-in's functions involves opening a new instances of word/excel (while the original is still open).

     

    Is there's anyway to bypass this problem?

    Can you explain why an Add-in would need to start a new instance of the application, rather than just creating a new document (or workbook)?

     

    As I mentioned, Word is not designed to work in this manner. The problem cannot be by-passed as you're dealing with a file-lock situation. And you have to remember that there's no guarantee you're in sole control of an appication instance. Other add-ins, including user-defined, could be running in any instance of Word and could be causing changes that will trigger this prompt.

    Wednesday, July 23, 2008 9:37 AM
    Moderator
  • Hello Cindy

     

    The add-in is a part of document management web-based system which my company develops. The user can use the add-in in order to navigate in the system and open a document from there. For reasons I cannot specify, I need to original document to stay open as I open another document

     

    Wednesday, July 23, 2008 2:50 PM
  •  Nissim Trabelsy wrote:

    The add-in is a part of document management web-based system which my company develops. The user can use the add-in in order to navigate in the system and open a document from there. For reasons I cannot specify, I need to original document to stay open as I open another document

    Then all you should need to do is use the Application.Documents.Open method to open the new document. This should open in the existing instance of the Word application. No need to start an additional instance.

    Thursday, July 24, 2008 2:53 PM
    Moderator
  • Hey Cindy

    thank you very much. issue solved!

     

    Sunday, July 27, 2008 7:23 AM