add-in -> save question when quiting word

W

ward

Hello,

I've created a Word add-in. When the user quits Word,
sometimes he is prompted with the question if he wants to
save the changes to the add-in. This is undesirable.

I figured out that this is because the add-in contains a
toolbar of which i change some button's status through VBA
while the users interacts with the add-in (there're some
buttons indicating the current language by a depressed
button).

How can I prevent the add-in "Save?" question from
appearing every time one quits Word or unloads the add-in?

thanks,
Ward
 
W

ward

Almost.
The problem is that the AutoClose and AutoExit procedure
are apparently executed AFTER the user is prompted to save
the add-in (which seems silly to me).
Any idea of an event fired before that?
Ward
 
W

ward

I've found a solution by using the Application
DocumentBeforeClose event. This event is fired before the
user is prompted to save changes.

However, it required my to create an additional class etc.
(For implementing application events, see also
http://www.mvps.org/word/FAQs/MacrosVBA/AppClassEvents.htm)

In the DocumentBeforeClose procedure i've inserted your
code lines.

It works fine now

thanks Helmut,
Ward
 

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