Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Apr 2002
    Location
    Sydney Australia, New South Wales, Australia
    Posts
    72
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Before Save Event in Word really isnt (Word 2000)

    The BeforeSaveEvent in word 2000 occures when the dialog is shown not when the save button on the dialog is selected.
    The result of this is that there appears to be no way of knowing where the document will be saved.
    i.e. path information is not available until after the save button is selected which is too late if you want to run a macro to update the document based on where it will be saved.
    Does anyone out there know a way around this ?

    Is this a Microsoft bug, error ?

  2. #2
    Star Lounger
    Join Date
    Jan 2001
    Location
    L.A., California
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Before Save Event in Word really isnt (Word 2000)

    As mentioned in other threads, you can "intercept" the File/Save and File/SaveAs commands, and replace them with your own, simply by creating macros with the same names, and Word will run yours before trying to run the generic commands. No menu modifications necessary.

    At this point, you could use the file/save common dialog to get the location you want, then do any code stuff you want before actually saving the document.

    Alternatively, as was done in one of my previous projects, you could write your own userform for saving or saving as, and have even more control over things.

    Try this: In a new document, type some text. Go into the VB editor (Tools/Macro/Visual Basic Editor). In the Project window, double-click on the "This Document" item to bring up a code window. Put the following code in:
    <pre>Sub FileSave()
    MsgBox "hello world"
    End Sub

    Sub FileSaveAS()
    MsgBox "hello world"
    End Sub
    </pre>

    Either the Save button, or the File/Save or File/Save As will call the message boxes instead of saving the document.

  3. #3
    Star Lounger
    Join Date
    Apr 2002
    Location
    Sydney Australia, New South Wales, Australia
    Posts
    72
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Before Save Event in Word really isnt (Word 2000)

    Thanks
    I became aware of the replace command technique a few days ago.
    Very nifty.
    However it doesn't help me intercept the path information.
    The project you worked on where you created your own browse input sounds very interesting.
    Can you tell me how I can do this, the browse bit is the hardest.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •