Results 1 to 9 of 9
  1. #1
    Lounger
    Join Date
    Jul 2001
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Modify File Save Command (Word 2000)

    We are using Word 2000.

    Users have a local copy of the normal.dot template located in C:Program FilesMicrosoft OfficeTemplatesNormal.dot.

    We have a "freeware metadata assistant tool" loaded in the users startup folder so it is available for them to analyse and clean their documents. It appears as a toolbar button and it also appeas on the File menu.

    We want to take this one step further and modify the File -> Save and File -> Save As commands to force the running of the metadata assistant tool.

    I can see how to modify internal word commands like File Save but I am having trouble adding the launch of the metadata tool inside of the File Save since it launches a dialog box. I tried recording a macro but that did not work.

    Any small thoughts on how to do this would be greatly appreciated.

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Modify File Save Command (Word 2000)

    Most Word dialogs have two methods to open them and allow for user interaction. The usual one, .Show, carries out the user's choice of action automatically, without giving you a chance to intervene. You can detect whether the user saved and do something additional, but you couldn't actually do it in the time before Word saves.

    The alternative, .Display, does not save immediately (or cancel immediately). To carry out the user's action after using .Display, you use .Execute (unless the user canceled, in which case you would not want to do that!). Between .Display and .Execute, you can do any number of interesting things. For a code example, see <post#=171202>post 171202</post#>.

  3. #3
    Lounger
    Join Date
    Jul 2001
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Modify File Save Command (Word 2000)

    Thanks for the post of your code snippet.

    One additional question. See your code snippet below. On the .Execute line I have added my question between the < ... > symbols.




    Sub FileSave()
    With Dialogs(wdDialogFileSaveAs)
    Select Case .Display
    Case 0 ' Cancel
    ' No need to do anything on Cancel
    ' Unless you want to display a message
    Case -1 ' OK
    ' Whatever you want to do on OK, for instance
    .Execute <Let the user save the document normally but then automatically launch the MetaData Assistant program within Word. How do I do this?>
    End Select
    End With
    End Sub

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Modify File Save Command (Word 2000)

    Would you want to launch the MetaData Assistant before or after actually saving the file? If before, on the line before .Execute, you would insert a new line that calls that program. If after, you would put in on the line after .Execute (before End Select).

    Now, I don't know the name of the procedure to call the MetaData Assistant. Does it appear in the Macros dialog?

  5. #5
    Lounger
    Join Date
    Jul 2001
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Modify File Save Command (Word 2000)

    It looks like the macro name is "ShowMetaCleaner".

    I tried .Execute ShowMetaCleaner but this error out.

    Any thoughts

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Modify File Save Command (Word 2000)

    Sorry, on a new line after .Execute all by its lonesome.

  7. #7
    Lounger
    Join Date
    Jul 2001
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Modify File Save Command (Word 2000)

    This is my code now:

    Sub FileSave()
    With Dialogs(wdDialogFileSaveAs)
    Select Case .Display
    Case 0 ' Cancel
    ' No need to do anything on Cancel
    ' Unless you want to display a message
    Case -1 ' OK
    ' Whatever you want to do on OK, for instance
    .Execute
    ShowMetaCleaner

    End Select
    End With

    End Sub


    However nothing seems to happen - the MetaData Assistant template is loaded in the startup group. The only macro in that template is ShowMetaCleaner. The macro is password protected

    ??? Strange.

  8. #8
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Modify File Save Command (Word 2000)

    Unfortunately, I can't help. Maybe someone who has this add-in can help you figure out how to run it from another macro.

  9. #9
    Lounger
    Join Date
    Jul 2001
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Modify File Save Command (Word 2000)

    Thanks to all who replied to this post.

    I finally figured out some code that would work:

    Sub FileSaveAs()
    CommandBars("PCG Metadata Assistant").Visible = True
    Application.Run ("ShowMetaCleaner")
    Dialogs(wdDialogFileSaveAs).Show
    End Sub

    Thanks

Posting Permissions

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