Yes to All button...msgbox, assistant.doalert?

April15Hater

Accountant
Local time
Today, 15:16
Joined
Sep 12, 2008
Messages
349
Hey guys-

I'm trying to figure out an easy way to get a Yes to All Button to appear on a msgbox type dialog but I'm not having much luck. I've tried Assistant.DoAlert, and that only displays an OK button. I think I'm looking at just making a custom form to do this; but more than anything I'm baffled as to whyI cant get the assistant command to work.

Code:
    With Application.Assistant
        Select Case _
            .DoAlert( _
            "Test", _
            "Click a button.", _
            msoAlertButtonYesAllNoCancel, _
            msoAlertIconCritical, _
            msoAlertDefaultSecond, _
            msoAlertCancelFirst, _
            False)

            Case vbYes: MsgBox "The user clicked Yes."
            Case vbNo: MsgBox "The user clicked No."
            Case vbCancel: MsgBox "The user clicked Cancel."
            Case 8: MsgBox "The user clicked Yes To All" 'This is the return value for YesToAll
            Case Else
        End Select
    End With
 
Thanks David. I was able to get the button to change using the UI, but I can't figure out how it does it. I stepped through it and the msgbox fucntion shows 35 for the Buttons Agrument, and the rest of the args seem pretty straightforward. Is there something I'm missing?
 

Users who are viewing this thread

Back
Top Bottom