• Save to act as SaveAs (Office 2000 Word 2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Save to act as SaveAs (Office 2000 Word 2000)

    Author
    Topic
    #373130

    Hi,

    When I click the Save As tool button in the std toolbar or File/Save As, I can get my macros to start a procedure which does more than just save the document with an other name. I have used a procedure called “Sub FileSaveAs()” in which I can put my code.

    When the document(file) has status “ReadOnly” and I click File/Save, the “Save As” disalog box appears as expected, but I cannot find any way to start my procedure as I can by using “Sub FileSaveAs()”.

    I cannot name a procedure as “Sub FileSave()”. it looks as it is not possible.

    Can anyone help me??

    Regards
    Bj

    Viewing 0 reply threads
    Author
    Replies
    • #598756

      Hi Bj

      • #598776

        Thanks a lot.
        It works!!

        I must have mist out some letters in the code.

        An other Q:

        What code to put in if I want to intercept the Cancel command on the Save As dialog box?

        Thanks in advance

        Regards
        Bj

        • #598781

          Try something like this:

          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
          End Select
          End With

          The Display method of a dialog will show the dialog without applying the settings. The result of Display is -1 if the user clicks OK, 0 if the user clicks Cancel. If the result is -1, the Execute method applies the settings.

          • #598782

            Things are simple as long as one know, else it is difficult. It is very difficult to search for that type of help in VBA Help.

            Anyway thanks a lot. I will try this out asap.

            Regards
            Bj

            • #598912

              Yes, it can be VERY difficult to find out the little things, particularly regarding the built-in dialogs. To test return values, you can use one of the following procedures, since .Display doesn’t actually execute the action (with a few exceptions that have occasioned discussions on this or the VB board):

              Sub DispDontExecMsg()
              MsgBox “Return value = ” & Dialogs(wdDialogFileSaveAs).Display
              End Sub

              Sub DispDontExecPrint()
              Debug.Print “Return value = ” & Dialogs(wdDialogFileSaveAs).Display
              ‘ String appears in the Immediate window
              End Sub

            • #598992

              Thanks to all of you, I verry much appreciat your help!

              I will try out the code asap.

              To my experience this is the best place to get and give help and information!

              Best regards
              Bj

    Viewing 0 reply threads
    Reply To: Save to act as SaveAs (Office 2000 Word 2000)

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

    Your information: