OFF2000: MsgBox Function Example Does Not Use vbMsgBoxHelpButton Constant (236806)



The information in this article applies to:

  • Microsoft Excel 2000
  • Microsoft FrontPage 2000
  • Microsoft PowerPoint 2000
  • Microsoft Word 2000

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

				

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:

236808 OFF2000: New Behavior with MsgBox Function


Modification Type:MinorLast Reviewed:9/13/2006
Keywords:kbdocerr kbdta kbdtacode kbinfo KB236806