We help IT Professionals succeed at work.

helpfile in msgbox using VB

surajdeo
surajdeo asked
on
Dear friend,
Please tell me how to open helpfile using msgbox
Comment
Watch Question

This example uses the MsgBox function to display a critical-error message in a dialog box with Yes and No buttons. The No button is specified as the default response. The value returned by the MsgBox function depends on the button chosen by the user. This example assumes that DEMO.HLP is a Help file that contains a topic with a Help context number equal to 1000.

Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Msg = "Do you want to continue ?"   ' Define message.
Style = vbYesNo + vbCritical + vbDefaultButton2   ' 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

Commented:
   MsgBox "Errormsg", vbCritical, "Errortitle", "error.hlp"

goes like that, or like this (straight out of the help file)

This example uses the MsgBox function to display a critical-error message in a dialog box with Yes and No buttons. The No button is specified as the default response. The value returned by the MsgBox function depends on the button chosen by the user. This example assumes that DEMO.HLP is a Help file that contains a topic with a Help context number equal to 1000.

Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Msg = "Do you want to continue ?"   ' Define message.
Style = vbYesNo + vbCritical + vbDefaultButton2   ' 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

TimCotteeHead of Software Services
CERTIFIED EXPERT

Commented:
virgils, you are new to EE but you should be aware of the guidelines. Not only have you posted an answer to a thread when it should have been a comment (see comments vs answers at bottom of this page) but you have also copied the previous comment in its entirety, merely to attempt to steal the points from the previous contributor. Your account and this thread will be reported to customer services for action. It is possible that this action may include a suspension / termination of your account, especially if this behaviour continues.
Based on the guidelines listed below, I am rejecting your proposed answer.


Thank you
Computer101
Community Support Moderator

Comments
Comments are intended to be used as a collaboration tool. Many Experts choose to post their solutions as comments only.

Answers
An answer is a specific solution to a question and should be submitted if it will solve the questioner's problem and doesn't duplicate a previous comment.

Comment Vs. Answer
If you are unsure of your solution, post it as a comment. Members can accept comments as solutions and award you Expert Points for them.

For more tips on comments and answers, click here.

Commented:
woops

Commented:
owhyah, and i jus didnt read the previous comment fully, just cut and pasted sumthing from the helpfile, jus like i said, and i didnt read the guidelines, that a mistake i made, guess i jumped to conclusions too quick, i thought i gave an answer

Explore More ContentExplore courses, solutions, and other research materials related to this topic.