Prevent a COM add-in from stealing the save event
-
- BronzeLounger
- Posts: 1254
- Joined: 03 Feb 2010, 19:59
- Location: Terneuzen, the Netherlands
Prevent a COM add-in from stealing the save event
In WORD2007, we have a COM Add-in loaded that adds classification to documents. For a tool I'm creating, I'd like to be able to prevent this from happening while my code is running. I cannot unload the add-in (admin rights required) nor change its code. I tried to program a "before save" event myself but the existing add-in seems to be getting preference and kicks in before my code does. Suggestions?
-
- Administrator
- Posts: 78532
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Prevent a COM add-in from stealing the save event
Where is your tool located? In the active document, in the template attached to the active document, in another add-in or in Normal.dotm?
Best wishes,
Hans
Hans
-
- BronzeLounger
- Posts: 1254
- Joined: 03 Feb 2010, 19:59
- Location: Terneuzen, the Netherlands
Re: Prevent a COM add-in from stealing the save event
Actually the tool runs from Excel, from there I create a file, control WORD to open the file, do some stuff and save the file back out, then close Word. The classification COM-addin interferes with automation as it's popping up when Word saves the file. I don't want that.
-
- Administrator
- Posts: 78532
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Prevent a COM add-in from stealing the save event
I don't know how to get around this problem. Does the COM add-in have any "hooks" to modify its behavior?
Best wishes,
Hans
Hans
-
- BronzeLounger
- Posts: 1254
- Joined: 03 Feb 2010, 19:59
- Location: Terneuzen, the Netherlands
Re: Prevent a COM add-in from stealing the save event
Nope, it's not mine (and protected)
-
- Administrator
- Posts: 78532
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Prevent a COM add-in from stealing the save event
I know it's flaky, but you could try using SendKeys to close the add-in's dialog.
Best wishes,
Hans
Hans
-
- 2StarLounger
- Posts: 196
- Joined: 31 Mar 2011, 03:41
- Location: Perth, Western Australia
Re: Prevent a COM add-in from stealing the save event
Are you able to open a WORD session that prevents add-ins being loaded?
Regards
Kevin
Regards
Kevin
-
- BronzeLounger
- Posts: 1254
- Joined: 03 Feb 2010, 19:59
- Location: Terneuzen, the Netherlands
Re: Prevent a COM add-in from stealing the save event
No, that's the approach I've been focusing on also. I do not seem to be able to start WORD from VBA with a command line argument like "/a" (even if that would prevent COM addins from loading).Becks wrote:Are you able to open a WORD session that prevents add-ins being loaded?
Regards
Kevin
Alternatively, I tried various approaches to unload the add-ins after WORD has started, that works but then a dialog box pops up requiring user-interfacing as admin rights are required for the specific COM add-in to be unloaded...
-
- Microsoft MVP
- Posts: 656
- Joined: 24 Jan 2010, 17:51
- Status: Microsoft MVP
- Location: Weert, The Netherlands
Re: Prevent a COM add-in from stealing the save event
I'd contact the author of the COM add-in and ask them for a way to (temporarily) disable it.
-
- 5StarLounger
- Posts: 689
- Joined: 27 Jan 2010, 16:45
- Location: Ottawa, Ontario, Canada
Re: Prevent a COM add-in from stealing the save event
Just a wild hope, but do you need admin rights to move the .com file?
Regards
Don
Don
-
- BronzeLounger
- Posts: 1254
- Joined: 03 Feb 2010, 19:59
- Location: Terneuzen, the Netherlands
Re: Prevent a COM add-in from stealing the save event
I'm going to but I need this to work for me on 0.1% of the systems so I doubt if changes will be made (if I could find the author in the first place) ...Jan Karel Pieterse wrote:I'd contact the author of the COM add-in and ask them for a way to (temporarily) disable it.
-
- BronzeLounger
- Posts: 1254
- Joined: 03 Feb 2010, 19:59
- Location: Terneuzen, the Netherlands
Re: Prevent a COM add-in from stealing the save event
I had thought about that too. Problem is that after my tool runs, all should be back to normal, if I move the addin (IF I could), I'd have to move it back afterwards. What if there's an error in my tool one day...Don Wells wrote:Just a wild hope, but do you need admin rights to move the .com file?
-
- Microsoft MVP
- Posts: 656
- Joined: 24 Jan 2010, 17:51
- Status: Microsoft MVP
- Location: Weert, The Netherlands
Re: Prevent a COM add-in from stealing the save event
Well, perhaps there already is a way to do that programmatically, they just need to tell you how?
-
- BronzeLounger
- Posts: 1254
- Joined: 03 Feb 2010, 19:59
- Location: Terneuzen, the Netherlands
Re: Prevent a COM add-in from stealing the save event
Actually when I approached them, it appeared that they've been thinking about this too and now have this functionality already in Beta... Looks like my problem is going to solve itself afterall...Jan Karel Pieterse wrote:Well, perhaps there already is a way to do that programmatically, they just need to tell you how?
Thanks for all the help and suggestions to all, it was usefull and if I can't get it afterall, I'll revive the search for the fundamental problem (stopping the Com adding somehow) here.