The information in this article applies to:
Advanced: Requires expert coding, interoperability, and multiuser skills. This article applies to a Microsoft Access database (.mdb) and a Microsoft Access project (.adp). SUMMARYThis article shows you three techniques that you can use to programmatically display a Help file. MORE INFORMATIONMicrosoft provides programming examples for illustration only, without warranty
either expressed or implied, including, but not limited to, the implied warranties of
merchantability and/or fitness for a particular purpose. This article assumes that you
are familiar with the programming language being demonstrated and the tools used to
create and debug procedures. Microsoft support professionals can help explain the functionality
of a particular procedure, but they will not modify these examples to provide added
functionality or construct procedures to meet your specific needs. If you have limited
programming experience, you may want to contact a Microsoft Certified Solution Provider
or the Microsoft fee-based consulting line at (800) 936-5200. For more information about
Microsoft Certified Solution Providers, please see the following page on the World Wide Web:
http://www.microsoft.com/mcsp/For more information about the support options available from Microsoft, please see the following page on the World Wide Web: http://www.microsoft.com/support/supportnet/overview/overview.asp Method 1You can use the Shell command to display a Help file. To do so, follow these steps:
or
Method 2When you run the code in Method 1 for the first time, the form will most likely open on the Contents tab of the Help file. However, if you then switch to the Index tab, close the Help file, and run the code again, the Index tab will be displayed. Whichever tab was last active is displayed each time that you run the code.If you have Microsoft Office 2000 Developer, you can avoid this behavior by using the Common Dialog control. To do so, follow these steps:
Method 3A more powerful way to display a Help file is to use Microsoft Windows API calls. These require some functions that you must first type into a module. To do so, open a new module, and type the following code. (Descriptions of how to use each of these API functions appear at the end of this article.)NOTE: You may have some Microsoft Windows API functions defined in an existing Microsoft Access library; therefore, your declarations may be duplicates. If you receive a duplicate procedure name error message, remove or comment out the declarations statement in your code.
The above code provides some useful functions for displaying Help files. The list below describes the purpose of each.NOTE: The following examples use the Help file "Calc.hlp", because it is usually in the System folder, and does not require a complete path.
You can use the OpenHelpContainer function simply to open a Help file. To test this function, type the following in the Immediate window, and then press ENTER:This opens the Help file for the Microsoft Windows Calculator. Opens the Help file with the Index tab activated. To test this function, type the following in the Immediate window, and then press ENTER:This opens the Help file for the Microsoft Windows Calculator with the Index tab displayed. Opens the specified Help index and searches for a keyword. To test this function, type the following in the Immediate window, and then press ENTER:Note that the "Simple Calculations" topic ID is displayed. Opens the Help file to a specified ContextID. To test this function, type the following in the Immediate window, and then press ENTER:Note that it opens Help for the division button. Opens the Help file to a specified ContextID as a pop-up window. To test this function, type the following in the Immediate window, and then press ENTER:Note that it opens Help for the division button in a pop-up window. Closes the Help file. To test this function, type the following in the Immediate window, and then press ENTER:This should close the Microsoft Windows Calculator Help file if it is open. REFERENCESFor more information about getting help with Visual Basic for Applications, please see the following article in the Microsoft Knowledge Base: Q226118 OFF2000: Programming Resources for Visual Basic for Applications Additional query words:
Keywords : kbdta AccCon PgmHowto KbVBA |
Last Reviewed: July 6, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |