Stop Word From Closing...

Add-in Express™ Support Service
That's what is more important than anything else

Stop Word From Closing...
Can I stop work from Closing? 
GKoehn




Posts: 37
Joined: 2009-03-23
My add-in needs to load some data into memory.
I would like to block the user from closing Word until this process is completed.
Is there any way to do this?
Posted 19 Aug, 2014 22:56:32 Top
Andrei Smolin


Add-in Express team


Posts: 14140
Joined: 2006-05-11
Hello Gregory,

If you do this in a Word event or in an event of a Ribbon control, the UI is locked and the user is unable to close Word. Is this what you are looking for?

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 20 Aug, 2014 01:56:29 Top
GKoehn




Posts: 37
Joined: 2009-03-23
I am loading a dll that has a thread in it. The thread, inside the dll, is loading data. This dll gets loaded when Word starts, so sometimes the dll is not done loading when the user closes Word. This dll has call backs that tell me when data is loaded. I would like to prevent the user from closing Word, if the dll is not done loading.

This add-in needs, at times, 50,000 records of data.
The UI that the user sees, shows all 50,000 rows.
That is why we thread the load of the 50,000 rows so, when Word is being used, the data access to the 50,000 is instant.
There are times when the user opens Word to view a doc and then closes it before this loading is complete.
That can generate errors to the user.
If I could block the Exit of Word then I could eliminate these errors.
Posted 20 Aug, 2014 09:36:19 Top
Andrei Smolin


Add-in Express team


Posts: 14140
Joined: 2006-05-11
Hello Gregory,

You need to have a possibility to cancel loading data. If this is a third-party DLL, I'd suggest contacting the vendor. In the Quit event of the Word Events component, you cancel the thread, wait for it to complete and then let Word close the UI.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 21 Aug, 2014 07:14:32 Top
GKoehn




Posts: 37
Joined: 2009-03-23
Thanks for the info about the Quit Event of Word.
I have a method in there that keeps a tight loop until the dll is completed its loading cycle.
Then Word continues to close perfectly!

On a Side Note...
I have a product called Worldox(http://www.worldox.com/) installed in one of my VM.
Worldox blocks my Add-in from ever receiving the "Quit" event!
Arg!!!!
I have contacted Worldox to see what we can do!
Posted 22 Aug, 2014 15:28:46 Top
Andrei Smolin


Add-in Express team


Posts: 14140
Joined: 2006-05-11
Many thanks, Gregory!

May I ask you to post here any outcome of your contacts with them? In case the topic is closed by the time you have any news (typically, this occurs in 30 days after the last post), please send it to the support email address and I'll reopen the topic.

Just in case they need us to create a test add-in or such, we are ready to help.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 25 Aug, 2014 05:29:36 Top
Andrei Smolin


Add-in Express team


Posts: 14140
Joined: 2006-05-11
Hello All,

Many thanks to Gregory! He updated me with this bit of info that may be useful for you.

Worldox replied...
----------
Our template developer suggested to deploy the following switches to help resolve the issue.

>From the WORLDOX.INI file
[Word-2007]
wdWordQuit=1


From the WDRSMAIN.INI file
[DisableX]
WordPerfect*=0
OpusApp=0
XLMAIN=0

Close and reload Worldox to capture the changes.
----------

Thanks!

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 06 Oct, 2014 07:33:29 Top