• Message Box modality? (Word97/2000)

    Author
    Topic
    #383707

    Can I modify the modality of a message box? I have, in my code:

    Response = MsgBox(“To format this table, place your cursor in the first cell and select OK.”, vbOKCancel + vbQuestion + vbDefaultButton2, “Insert Module Outline”)
    If Response = vbCancel Then Exit Sub

    If the user has their cursor in a part of the document other than the first cell of a table, I want them to be able to move it to the first cell without canceling.

    Viewing 2 reply threads
    Author
    Replies
    • #655142

      Message boxes are always modal, AFAIK there is nothing you can do about that, but perhaps somebody will come up with some Windows API calls to remedy that.

      In Word 2000, you can create a userform that looks like a message box and open it as a modeless form:

      frmMessage.Show Modal:=vbModeless

      In Word 97, userforms are always modal.

    • #655177

      Try experimenting with the script host:

      Dim wsh As Object
      Set wsh = CreateObject(“WScript.Shell”)

      wsh.Popup “If you want, move this out of the way.”, , “Modeless, Man”

    • #655231

      Although it strikes me as being a bit more work, maybe you could do it with a custom toolbar and button with a long label? In starting to code an example of this, I encountered two issues. First, the code to do what the user wants to do needs to be in a separate procedure called by the toolbar button. This is much less convenient than a nonmodal UserForm (which you can have in Word 2000). Second, I don’t see a simple way to handle the user closing the toolbar itself (by accident or on purpose) thereby losing access to the button. Oh well…

    Viewing 2 reply threads
    Reply To: Message Box modality? (Word97/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: