Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Jun 2002
    Location
    Durham, North Carolina, USA
    Posts
    140
    Thanks
    5
    Thanked 1 Time in 1 Post

    Showing a dialog box ONLY the first time (Word 97/VBA)

    I have a dialog box which I want to show only the first time a document is opened. What's the best way to handle this?

    I have the dialog attached to the OPEN event.

    Thanks in advance,

    Beej

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Showing a dialog box ONLY the first time (Word 97/VBA)

    What is "the first time a document is opened"?

    The time it is created? If so, use the Document_New event.

    The first time it is opened by me? What if it is next opened by somebody else?

    You could have a look at document variables (the Variables collection in Word VBA) or custom document properties (the Properties collection) to store a "HasBeenOpened" flag.

    Or if it's user-dependent, you could write a value to the Registry (see SaveSetting and GetSetting).

Posting Permissions

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