Application.Documents.Open closing the un saved word documents
-
jueves, 03 de mayo de 2012 23:22
I am opening an existing word document using below code.
m_WordAppln.Documents.Open(ref varFileName, ref m_Missing, ref m_Missing, ref m_FalseValue,
ref m_Missing, ref m_Missing, ref m_FalseValue, ref m_Missing, ref m_Missing, ref m_Missing, ref m_Missing, ref m_Missing, ref m_Missing,
ref m_Missing, ref m_Missing, ref m_Missing);Above above API is closing other un saved open word documents. (just open a new document using winword.exe from start menu)
How to fix this problem?
- Editado Akella Srinivas jueves, 03 de mayo de 2012 23:25
Todas las respuestas
-
viernes, 04 de mayo de 2012 6:11Moderador
Hi Akella
The behavior you described is by design. This is what happens when the user starts Word (a blank document is generated automatically), then opens a document (the blank document is closed). The assumption is that the user doesn't want to work with this new document when the first action is to open an existing one. So to save the user effort, the blank document is closed.
If you need the blank document, you either need to make some changes in it (make it "dirty"), save it, or simply create another new one (m_WordAppIn.Documents.Add(//params here);
Cindy Meister, VSTO/Word MVP
- Propuesto como respuesta JosephFox viernes, 04 de mayo de 2012 8:16
- Marcado como respuesta Quist ZhangMicrosoft Contingent Staff, Moderator lunes, 07 de mayo de 2012 2:53

