• Date and Time window (Word 97)

    Author
    Topic
    #361707

    I want to edit the Date and Time window that appears when you go to Insert | Date and Time. Is this possible? And if so, how do I open it up (in VBA I assume) so that I can edit it. I’m trying to disable or just TAKE OFF the “Update Automatically” option. Found that trying to recreate the Date and Time window from scratch was a little more difficult that I thought it would be.

    Viewing 0 reply threads
    Author
    Replies
    • #547546

      The following routine will display the Insert date/time dialog box. The InsertAsField (the Update checkbox) at the bottom is then set to false, regardless of the user selection. Finally the settings are caried out, including cancel, if that was clicked.

      Sub myinsert()
      With Dialogs(wdDialogInsertDateTime)
      .Display
      .InsertAsField = False
      .Execute
      End With

      End Sub

      You can set properties proir to displaying a dialog box using the same method as above. If you use .Show instead of .Display the box will execute on clicking OK. Have a look at built in argument list in VBA help and displaying dialog boxes.

      Ewan

      • #547619

        In this case, you also can set the checkbox before you pop up the dialog. So, to replace the default InsertDateTime command, you just put this somewhere in your Normal.dot (e.g., under New Macros):

        Sub InsertDateTime()
        MsgBox “Hi, Mom” ‘for testing only, to make sure it is running!
        With Dialogs(wdDialogInsertDateTime)
        .InsertAsField = False
        .Show
        End With
        End Sub

        (Tested in Word 2000. Hope it works in 97, too.)

    Viewing 0 reply threads
    Reply To: Date and Time window (Word 97)

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

    Your information: