Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Edison, New Jersey, USA
    Posts
    215
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Message Box modality? (Word97/2000)

    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.

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

    Re: Message Box modality? (Word97/2000)

    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.

  3. #3
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Message Box modality? (Word97/2000)

    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"
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  4. #4
    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: Message Box modality? (Word97/2000)

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

Posting Permissions

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