none
Intercepting Save related commands in Word 2003 RRS feed

  • Question

  • Hello,

    does anyone know if it is possible to intercept Word's Save and SaveAS commands  using VSTO (VBA allowes it)?

    Interception should work for all documents so that I can apply custom operations to each document before it is saved.

    Standart event handlers work only for a particular document or template. Once they are closed events are not fired for other documents.

    Substitution of Normal.dot hasn't worked because Word doesn't execute managed code refered by substituted template at least by default (why and could this behaviour be changed?).

    -- Thanks in advance.

     

     

     

     

     

     

    Friday, August 11, 2006 1:23 PM

Answers

  • This can't be done for ALL documents using VSTO because - currently - VSTO is document-specific. What you're looking for is a COM Add-in. You can create COM addins using managed code, but it's a bit complex.

    The next version of VSTO (v3, currently CTP, see the threads at the top of this forum) will support application-level Addins for Office apps.

    And no, there's no way to intercept commands directly in Word, using ONLY managed code, the way you can with VBA. Same goes for keyboard shortcuts, just for the record. What is possible is to use VBA to call managed code wrapped as a COM DLL.

    Friday, August 11, 2006 1:33 PM
    Moderator