Click here to Skip to main content
15,921,716 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to control the user open and close some MS Word document.
In my program,when the user want to open a document,I create a new Word.Application and a new Document ,then open the document.
when the user close the document or the MS Word,I want to prompt the user if he or she would like to overwrite the exsit file.I hope someone would like to give me a solution.
Posted

If you use a SaveFileDialog to ask the user where they would like to save the file to, then you can set the OverwritePrompt property to true, and then the user will be prompted if they want to overwrite an existing file.
 
Share this answer
 
Well, you could look at the Microsoft Tools for Office, for ways to control Word via .NET, but I'm not sure they will allow you to do that. Word itself should prompt you to save a file, and Process.Start on a .doc file will open it in Word.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900