Hamid,
As far as I can tell, there is on 'OnChange' event in the Word object model.
There _is_ a 'Change' event, but it doesn't appear to be associated with the
Document object. The closest I can think of is doing something around the
Saved property of the Document object. This property will be set to "False"
if any edits have been made to the document. (This is what Word works with
when determining whether or not to prompt to save changes when a document is
closed.) Therefore, it may be possible to write code associated with the
DocumentClose, Save and SaveAs events that evaluates the Saved property and
executes if the document is "dirty". Unfortunately, I have no idea how this
code would call "some kind of webservice", as this is beyond the scope of my
knowledge.
However, it seems to me that there are better tools for the job than VBA. If
my understanding of "having his changes be persisted to a database or a
document residing on a server" is correct, this is one of the basic functions
of an electronic document management system (EDMS). There are many such EDMS
products available, and most integrate seamlessly with Word, as well as other
Office applications. They come in varying "sizes" to meet the needs of
businesses with anywhere from 2 to 2000+ users. A Google search for "EDMS"
should turn up several lines of enquiry for you.
--
Cheers!
Gordon Bentley-Mix
Word MVP
Please post all follow-ups to the newsgroup.
Read the original version of this post in the Office Discussion Groups - no
membership required!
Hi Gordon and others,
I followed your advice and came up with a lot of information on EDMS
systems but that doesn't appear to do the trick.
Let me explain what exactly my problem is:
We have a Java application, that generates reports, documents that are
sent to people based upon data they fill in themselves in different
forms of our application that are presented to them in a wizard kind
of thing. These documents need (all of them) a little modification
upon generation and before being printed. Our java application is able
to generate more than 300 types of documents and there can be assumed
that hundreds of documents are being generated on a weekly basis. So I
guess you see what the problem is. The customer spends a lot of time
modificatying the documents.
To avoid this in the future, the customer would like some kind of a
wysiwyg tool that permits them to change the way some of the documents
are generated. So, I thought why not do this in the environment they
are actually using to this manual modifications, which is MS Word.
So, this being said, I came up with VBA to filter out the exact
modification, and call a webservice, merely a small part of our
application that would be exposed for this kind of action.
This web service would just wait for a modification to be sent, then
it would be translated into a Jasper Report template, then all future
documents of that particular type would get generated, including the
new modifications.
I thank you all for taking the time to read this,
Sincerelly,
Hamid Komairi
Analyst Developer