How to know if a document is open/changed?
-
From my application I am opening a document (could be Word, pdf, anything) using ShellExecute(). Now how can I check whether: (i) The document is still open. (ii) Some unsaved changes are made to that document. We can not watch a directory for changes because that will work only when changes are saved to documents or new documents are created.
It's better to know some of the questions than all of the answers.
Pravin. -
From my application I am opening a document (could be Word, pdf, anything) using ShellExecute(). Now how can I check whether: (i) The document is still open. (ii) Some unsaved changes are made to that document. We can not watch a directory for changes because that will work only when changes are saved to documents or new documents are created.
It's better to know some of the questions than all of the answers.
Pravin.PravinSingh wrote:
(i) The document is still open.
You can't. You can, however, know if the application itself is still open.
PravinSingh wrote:
(ii) Some unsaved changes are made to that document.
Not possible that I know of.
PravinSingh wrote:
We can not watch a directory for changes because that will work only when changes are saved to documents or new documents are created.
So unless those changes are committed to disk, why worry about them?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
PravinSingh wrote:
(i) The document is still open.
You can't. You can, however, know if the application itself is still open.
PravinSingh wrote:
(ii) Some unsaved changes are made to that document.
Not possible that I know of.
PravinSingh wrote:
We can not watch a directory for changes because that will work only when changes are saved to documents or new documents are created.
So unless those changes are committed to disk, why worry about them?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
DavidCrow wrote:
So unless those changes are committed to disk, why worry about them?
In my applicaltion I have a record with an attached document (which I am opening with ShellExecute). Before navigating away from this record, I want to warn the user of any unsaved changes in the attached document.
It's better to know some of the questions than all of the answers.
Pravin. -
DavidCrow wrote:
So unless those changes are committed to disk, why worry about them?
In my applicaltion I have a record with an attached document (which I am opening with ShellExecute). Before navigating away from this record, I want to warn the user of any unsaved changes in the attached document.
It's better to know some of the questions than all of the answers.
Pravin.What are you trying to do, some sort of work-flow application? If so you are going about it the wrong way, operating on assumptions that are unfounded. Try doing some research on whatever problem you are trying to solve and see what knowledge the industry has that might be of help to you.
-
What are you trying to do, some sort of work-flow application? If so you are going about it the wrong way, operating on assumptions that are unfounded. Try doing some research on whatever problem you are trying to solve and see what knowledge the industry has that might be of help to you.
-
sudheee wrote:
by tracking the position of the file pointer u can find whether the opened document have unsaved changes or not.
I'm going to give you the benefit of the doubt and assume you are kidding. Tracking whether a file has changed by looking at the file pointer is not even a remote possibility. :rolleyes:
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne