none
Programmatically created wordfile giving error while closing RRS feed

  • Question

  • HI,

    I am developing an application in which i have to write a letter in word after processing.After writting letter whose format was pre written.

    When i am going to close that file it is asking "Do you want to save changes you made to the Document" if i click on "Don't Save" then the word if giving error "The file is in use by another application or user .(C:\Users\Admin\....\Normal.dotm)".



    ##Goals are not necessary to motivate us.They are essential to really keep us alive.##

    • Moved by Fred Bao Thursday, December 25, 2014 2:59 AM Office Related
    Wednesday, December 24, 2014 6:35 AM

Answers

  • Hi Vaibhavsaral,

    Based on the description, it seems that you are automating multiple instances of Microsoft Word simultaneously.

    If I unserderstood correctly, you can try the solution below to see whether it is helpful:

    • Before you quit Word or transfer control to the user, set the Saved property of the Normal.dot template to True as follows:
      Application.NormalTemplate.Saved = True
      					
      -or-
    • Set the SaveChanges argument for the Quit method as follows:
      Application.Quit SaveChanges:=wdDoNotSaveChanges
      
      

    You can get more detail about this error message from link below:

    Prompt to save Normal.dot when using Word as an automation server

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, December 26, 2014 3:15 AM
    Moderator

All replies

  • I think it has to do with your chunk of code. Perhaps it will help if you would post also the code you written.
    Wednesday, December 24, 2014 10:42 PM
  • Please check the code for the click event of the Don't Save button or your can post your code here and others can together resolve your problem.

    -----------------------------------------------

    Hope above help !

    Doanh

    Thursday, December 25, 2014 2:15 AM
  • Hi Vaibhavsaral,

    Based on the description, it seems that you are automating multiple instances of Microsoft Word simultaneously.

    If I unserderstood correctly, you can try the solution below to see whether it is helpful:

    • Before you quit Word or transfer control to the user, set the Saved property of the Normal.dot template to True as follows:
      Application.NormalTemplate.Saved = True
      					
      -or-
    • Set the SaveChanges argument for the Quit method as follows:
      Application.Quit SaveChanges:=wdDoNotSaveChanges
      
      

    You can get more detail about this error message from link below:

    Prompt to save Normal.dot when using Word as an automation server

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, December 26, 2014 3:15 AM
    Moderator