Change in ALT-F4 / X-close event handle in Word2003 ?

N

Nikolai Kirsebom

We have an application where we use Word (through automation) for
editing text. Macros in a template file (DOT-file) controls the
saving of the edited document in a database.

In Word97, Word2000 and Word2002 the system handles the situation
where the user has made changes to the document and presses either the
X (upper right hand corner of the application) or selects the Close
menu entry from the system menu entry (also available through the
short-cut ALT-F4). We have taken control of the 'closing of the
application/document' and in these situations, the user is presented a
dialog where he is requested to confirm if the changes should be
saved. This is coded in the Document OnClose event.

In Word2003 this does not work. When the Document OnClose event is
'fired' the document's Saved property is True - even if the content is
changed. We are using the same DOT-file in the two environments
(identical code), and the application code (MFC) controlling Word
through automation is also the same (identical).

Does anyone know if there has been a change in the way events / Saved
property is handles in Word2003.

Any help is appreciated.

Nikolai

Note that even if we override (define our own callback) the ALT-F4
short-cut, only the short cut is overridden and not the Close menu
entry from the systsem menu (upper left hand corner of application).
 
N

Nikolai Kirsebom

Solved by moving code from Document_Close method to
DocumentBeforeClose event handler.

Nikolai
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top