Results 1 to 3 of 3
  1. #1
    5 Star Lounger kmurdock's Avatar
    Join Date
    Feb 2003
    Location
    Pacific Grove, California, USA
    Posts
    716
    Thanks
    10
    Thanked 34 Times in 28 Posts

    WinHelp and Word VBA (Windows XP Pro & Office XP Pro)

    Hooboy, have I been spinning my wheels over this.

    I am trying to include help with my various Word templates and have successfully implemented popup help using the ContextID and WinHelp.

    Now I would like to add a "Help" button that will pull up more generalized help for the whole template and know that with Word, I will need to call the WinHelp API.

    I have followed the instructions of Jonathan West in his MVP article <A target="_blank" HREF="http://word.mvps.org/FAQs/MacrosVBA/DisplayWinHelp.htm">
    Displaying WinHelp files from VBA</A> with minimal success.

    I can make the HELP_CONTEXT command work, which displays a HUGE window with the small bit of help text swimming near the top. I can't control the size of the window. But more than that, I would really like this help to look and act like a popup, too. Trying to invoke any other kind of help has not worked. The code used to call the Help is:

    Dim iTemp As Long
    iTemp = WinHelp(0, strHelpFile, HELP_CONTEXT, iContextID)

    In this code iTemp =1. If I use any other command (such as HELP_CONTEXTPOPUP, which has a value of &H8), iTemp = 0 and nothing happens.

    I cannot find enough information out there regarding WinHelp and VBA to be able to figure this out anytime before 2005. ANY help will be appreciated.

    Thanks, Kim <img src=/S/brickwall.gif border=0 alt=brickwall width=25 height=15>

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: WinHelp and Word VBA (Windows XP Pro & Office XP Pro)

    I don't know whether the sample code in ACC2000: How to Programmatically Display a Help File (MSKB 209843), "Method 3," provides any further insight.

    The article HELPWININFO Structure on MSDN contains some C syntax for sizing the WinHelp window, but I find converting between C and VB somewhat mysterious. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

  3. #3
    5 Star Lounger kmurdock's Avatar
    Join Date
    Feb 2003
    Location
    Pacific Grove, California, USA
    Posts
    716
    Thanks
    10
    Thanked 34 Times in 28 Posts

    Re: WinHelp and Word VBA (Windows XP Pro & Office XP Pro)

    Hey, I have an idea! Maybe Microsoft could make VBA work the same way in all its Office programs!

    (What's all that sniggering I hear???) <img src=/S/tongue.gif border=0 alt=tongue width=15 height=15>

    I had already found the article you mentioned and the important part of the command is the parameter that specifies what kind of window is in play. Unfortunely, Word doesn't recognize "hWndAccessApp" as a legitimate parameter for Word. <img src=/S/disappointed.gif border=0 alt=disappointed width=15 height=15>

    So, I did some more searching and I **finally** found code that includes another call to the Help API and that fixed my problem. I have attached a document with the code necessary to call Help from a command button on a Word form and display it in a pop-up. <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23>

    The missing link was the

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •