• Hijacking (VBA/Word/2003)

    Author
    Topic
    #439199

    I want to gather statistics on document changes as they pass through a given process. To Achieve this I intend to capture statistics each time a file is opened, closed or Saved As.

    My initial thought was to hijack the commands; BUT while I can hijack File | Close, my hijacking code is ignored by as well as the Closing “x”. Curiously, hijacking the File | SaveAs command works with the F12 key.

    Is there any way to hijack the controls which are not invoked through the Menu Bar?

    TIA

    Viewing 1 reply thread
    Author
    Replies
    • #1048959

      This is rather a mess: the menu option executes FileClose, while Ctrl+F4 executes DocClose. Instead of using these two, you might create an AutoClose macro in your Normal.dot. This will be executed whenever a document is closed, regardless of the method used.

      • #1048995

        Hans

        You add emphasis to the title “Mentor” .

        Thank you.

        • #1049082

          Hans is right of course, but just in case you want to know anyway:
          DocClose catches the document close button (x), Ctrl+W and Ctrl+F4
          FileClose catches the menu-item File | Close
          FileExit catches application close button (X), the menu-item File | Exit and Alt+F4 (and closes Word too of course)

    • #1049099

      > gather statistics on document changes as they pass through a given process.
      I seem to have managed to capture save/saveas/close events for purposes of my MRUse utility. I maintain a file of selected positions to take the user to the selection next time the file is opened. This seesm to be working too.

      That leads me to believe that statistics is easy for save/close/saveas, including shutting down Word. In 200/2002/2003, Word/Excel too.
      Shall we talk?

      • #1049148

        Hi Chris
        I will be placing some supervisory code in the Normal template of a number of users. This supervisory code will run the stats gathering code which resides in an add-in, This way I will only need to visit the users machines once (I’m not about to suggest that they disable the virus protection, or reduce the Office security settings even temporarily), and upgrades to the stats gathering code can be implemented automatically.
        I intend to store the data in a csv file and analyse it with Excel.
        Since I will be collecting a lot of unnecessary data, I am not yet firm on how I will keep the data repository from swelling unnecessarily; but I don’t foresee any insurmountable problems.

        • #1049511

          ER, right, but what I meant (when I replied in too much of a hurry to make myself clear) was to ask where you were having problems.

          Are you now able to hijack all the save/saveas/close events?

          • #1049536

            Thanks for the interest Chris. With the support of the Lounge, in this instance I’ve got the hijacking aced.

    Viewing 1 reply thread
    Reply To: Reply #1049144 in Hijacking (VBA/Word/2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel