Microsoft KB Archive/236806

= OFF2000: MsgBox Function Example Does Not Use vbMsgBoxHelpButton Constant =

Article ID: 236806

Article Last Modified on 9/13/2006

-

APPLIES TO


 * Microsoft Excel 2000 Standard Edition
 * Microsoft FrontPage 2000 Standard Edition
 * Microsoft PowerPoint 2000 Standard Edition
 * Microsoft Word 2000 Standard Edition

-



This article was previously published under Q236806





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

