View Single Post
Old 08-30-2017, 02:21 PM   #629
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Now with a little longer response. The behavior that causes the ribbon to disappear is a tricky one. If Word crashes while some procedure of the add-in is running, Word automatically assumes the add-in is the culprit and will disable this. In itself that is not that strange I guess. It gets weirder when you close Word normally and the ribbon still disappear. That seems to be a hit and miss. Most people never see this, myself included. Others have this frequently. Causes and reason unknown...
The suggestion by BR however I think is correct. By default the S&R (and Mark file if you have it) is monitored for changes. The reason is that if you change that document outside the add-in (so not with the editor) while Word is running, the latest version will be used without restarting Word. At first I used a hash to check if the file was changed, but somehow this did not always work and gave issues (as reported by BR). Therefore I changed to this mechanism.
In the code it is detected when the close command is given to the add-in, which occurs when you close Word normally. If that event is fired, the procedure that detects changes to the S&R file is shutdown before Word, making it a clean shutdown.
I suspect, and it is just a suspicion, that in some cases stopping the procedure takes too long and Word closes anyway thinking the add-in crashed. I have no evidence of this, but it seems reasonable.

In the new version I am working on, this whole mechanism has been removed. However, this is not even close to ready as programming time is in very short supply at the moment... In the meantime if you do not need the functionality as described, you can set the environment variable as specified by BR. It might work.
Toxaris is offline   Reply With Quote