Re: Calling an application Help file from VBA???

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Rick Roberts (RickRoberts_at_discussions.microsoft.com)
Date: 01/27/05


Date: Thu, 27 Jan 2005 15:21:02 -0800

Thanks so much for the help. No pun intended

"Paul Overway" wrote:

> You didn't specify what type of help file, but these functions should
> help...
>
> Option Explicit
>
> 'These are used for HTMLHelp
>
> Private Const HH_DISPLAY_TOPIC = &H0
> Private Const HH_SET_WIN_TYPE = &H4
> Private Const HH_GET_WIN_TYPE = &H5
> Private Const HH_GET_WIN_HANDLE = &H6
> Private Const HH_DISPLAY_TEXT_POPUP = &HE ' Display string resource ID or
> ' text in a pop-up window.
> Private Const HH_HELP_CONTEXT = &HF ' Display mapped numeric value
> in
> ' dwData.
> Private Const HH_TP_HELP_CONTEXTMENU = &H10 ' Text pop-up help, similar to
> ' WinHelp's HELP_CONTEXTMENU.
> Private Const HH_TP_HELP_WM_HELP = &H11 ' text pop-up help, similar to
> ' WinHelp's HELP_WM_HELP.
>
>
> Private Declare Function HtmlHelp Lib "hhctrl.ocx" Alias "HtmlHelpA" _
> (ByVal hwndCaller As Long, ByVal pszFile As String, _
> ByVal uCommand As Long, ByVal dwData As Long) As Long
>
>
> 'These are used for WinHelp
> Private Const HELP_CONTEXT = &H1 'Display topic for Help context ID.
> Private Const HELP_QUIT = &H2 'Terminate Help.
> Private Const HELP_INDEX = &H3 'Display Help index.
> Private Const HELP_CONTEXTPOPUP = &H8& 'Display Help context as a pop-up
> 'window.
> Private Const HELP_FINDER = &HB& 'If found, Display container file.
> Private Const HELP_KEY = &H101 'Display topic for keyword.
>
> 'Declare the WinHelp function.
> Private Declare Sub WinHelp Lib "user32" Alias "WinHelpA" (ByVal hWnd As
> Long, _
> ByVal lpHelpFile As String, ByVal wCommand As Long, _
> ByVal dwData As Any)
>
> Function OpenWinHelpContainer(hWnd As Long, ByVal FileName As String)
> 'Opens the Help container.
> WinHelp hWnd, ByVal FileName, _
> HELP_FINDER, ByVal vbNullString
> End Function
>
> Function OpenWinHelpIndex(hWnd As Long, ByVal FileName As String)
> 'Opens the Help index.
> WinHelp hWnd, ByVal FileName, HELP_KEY, _
> ByVal ""
> End Function
>
> Function OpenWinHelpIndexToSearchKey(hWnd As Long, ByVal FileName As String,
> _
> ByVal SearchKey As String)
> 'Opens the Help index and searches for keyword SKey.
> WinHelp hWnd, ByVal FileName, HELP_KEY, _
> ByVal SearchKey
> End Function
>
> Function OpenWinHelpToContextID(hWnd As Long, ByVal FileName As String, _
> ContextID As Long)
> 'Opens the Help file to ContextID.
> WinHelp hWnd, ByVal FileName, _
> HELP_CONTEXT, ByVal ContextID
> End Function
>
> Function OpenWinHelpToContextIDPopup(hWnd As Long, ByVal FileName As String,
> _
> ContextID As Long)
> 'Opens the Help file to ContextID as a pop-up window.
> WinHelp hWnd, ByVal FileName, _
> HELP_CONTEXTPOPUP, ByVal ContextID
> End Function
>
> Function CloseWinHelpContainer(hWnd As Long, ByVal FileName As String)
> 'Closes the specified Help file.
> WinHelp hWnd, ByVal FileName, HELP_QUIT, _
> ByVal vbNullString
> End Function
>
> Function OpenHTMLHelp(hWnd As Long, FileName As String)
> Dim lngResult As Long
> 'Opens HTML help file
> lngResult = HtmlHelp(hWnd, FileName, HH_DISPLAY_TOPIC, 0)
>
> End Function
>
> Function OpenHTMLHelpToContextID(hWnd As Long, FileName As String, ContextID
> As Long)
> Dim lngResult As Long
> 'Opens HTML Help file to ContextID
> lngResult = HtmlHelp(hWnd, FileName, HH_HELP_CONTEXT, ContextID)
>
> End Function
>
>
> --
> Paul Overway
> Logico Solutions
> http://www.logico-solutions.com
>
>
> "Rick Roberts" <RickRoberts@discussions.microsoft.com> wrote in message
> news:09DFD7F3-9BE3-4C21-BFA2-E155E9BA1EF1@microsoft.com...
> > I'm sure that there is but I can't find the method to call an application
> > help file w/
> > context id.
> >
> > I have created a .hlp file and it works in a form using the f1 key but how
> > do you call it programatically from VBA. I do not want to use a message
> > box. I either want to call help or have the context as a pop up.
> >
> > Does this make sense? I'd be happy to clarify
>
>
>



Relevant Pages

  • Re: Printer commands
    ... the string) and I read the Help file, ... print out (rather than open the cash drawer) so that I can see if anything ... it prints a receipt and opens the cash drawer. ...
    (comp.databases.paradox)
  • Re: Calling an application Help file from VBA???
    ... Private Const HH_SET_WIN_TYPE = &H4 ... ByVal lpHelpFile As String, ByVal wCommand As Long, _ ... Function OpenWinHelpContainer(hWnd As Long, ByVal FileName As String) ... 'Opens the Help file to ContextID. ...
    (microsoft.public.access.modulesdaovba)
  • This one kept me busy for 2 hours...
    ... Description("Sets the path to a help file for the ... Public Property HelpFile(ByVal filename As String) As String ... can't believe that having the 'ByVal filename As String' in there makes the ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Newbie question re vb.net and iterating files
    ... A Google search should provide you with a solution to the security issue. ... Here's the code I copied the code below from a help file: ... For Each foundFile As String In My.Computer.FileSystem.GetFiles _ ...
    (microsoft.public.vsnet.general)
  • Re: ISALPHA or ISNUMERIC functions ?
    ... > determine if a character in a string is A-Z or 0-9. ... > locate the functions in the help file. ... Dim lngLenTemp As Long, lngLenStr As Long, i As Long ...
    (microsoft.public.access.queries)