Consulting

Results 1 to 3 of 3

Thread: Multiple Document_Open events possible?

  1. #1
    VBAX Regular
    Joined
    Jul 2020
    Posts
    11
    Location

    Multiple Document_Open events possible?

    Is it possible to run more than one Document_Open event upon opening?

    For example, a message box before a userform.

    If so, what is the code?

  2. #2
    You can run any number of commands from Document_Open. It is essentially just a macro that runs when a document is opened, saved in the ThisDocument module of the document. At its simplest -
    Private Sub Document_Open()
        MsgBox "This is a message"
        UserformName.Show
    End Sub
    The fact that you are opening a userform when the document is opened suggests that you are reusing a document. I would recommend that you use instead the Document_New event and save the document as a template from which new documents are created.
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

  3. #3
    VBAX Regular
    Joined
    Jul 2020
    Posts
    11
    Location
    Awesome.

    Appreciate the quick reply.

Posting Permissions

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