Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Apr 2001
    Posts
    304
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Date and Time window (Word 97)

    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.

  2. #2
    Lounger
    Join Date
    Aug 2001
    Location
    Shropshire, UK
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date and Time window (Word 97)

    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

  3. #3
    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: Date and Time window (Word 97)

    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.)

Posting Permissions

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