OFF2000: MsgBox Function Example Does Not Use vbMsgBoxHelpButton Constant

ID: Q236806


The information in this article applies to:
  • Microsoft Office 2000


SUMMARY

In Visual Basic for Applications Help, the "MsgBox Function" example does not include the vbMsgBoxHelpButton constant. This constant is required to display a Help button in a message box.


MORE INFORMATION

To correct the example for the MsgBox function in Visual Basic for Applications Help, add the vbMsgBoxHelpButton constant to the "Style" line of code as follow:


Style = vbYesNo + vbCritical + vbDefaultButton2 + vbMsgBoxHelpButton 
The following is the corrected version of the Help topic example:

Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Msg = "Do you want to continue ?"    ' Define message.

Style = vbYesNo + vbCritical + vbDefaultButton2 + vbMsgBoxHelpButton
' Define buttons.

Title = "MsgBox Demonstration"    ' Define title.
Help = "DEMO.HLP"    ' Define Help file.
Ctxt = 1000    ' Define topic
        ' context.
        ' Display message.
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbYes Then    ' User chose Yes.
    MyString = "Yes"    ' Perform some action.
Else    ' User chose No.
    MyString = "No"    ' Perform some action.
End If
End Sub 


REFERENCES

For more information about the MsgBox function, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type msgbox function in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

For additional information about using the vbMsgBoxHelpButton constant, please see the following article in the Microsoft Knowledge Base:

Q236808 OFF2000: New Behavior with MsgBox Function

Additional query words: OFF2000 ACC2000 XL2000 WORD2000 PPT2000 FP2000

Keywords : kbdocerr kbdta kbdtacode
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbinfo


Last Reviewed: December 17, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.