Is there a way to access VBA help files from command line

I need to write some vba modules for a project I'm working on and would prefer to use SciTe for the built-in editor in Office.

SciTe allows you to redirect the effect of the F1 strike into an arbitration command with the selected text as an argument. Is there a way to use this feature to find matching .chm files?

I guess not, given that the help for vba is spread over multiple files, but I hope someone can prove that I am wrong ...

I'm especially wondering if anyone can suggest a way to find out which chm file a particular library supports, simply from the fully delimited function name.

0


a source to share


3 answers


The core files are stored (for Office 2003 anyway) in Program Files\OFFICE11\1033

, but accessing the pages within them can be a bit tricky as Microsoft has gradually been forced to implement the ability to delve into CHM files over the years due to security concerns. This page ( download ) contains some useful information about what is still possible in relation to linking to certain pages within CHM

Having said that, I don't think this file is the standard support shown to most users at this time, but it is close enough, but in most cases only the wrapping of Office 2007 is missing. The online help seems to be the default, unless you specifically disabled it during Office installation. The URLs are not very SEO friendly I guess, so it was impossible to guess. I suppose you could take a bogus trick from scammers and ship URLs that point to the top link on Google in this way: Range .



EDIT: Link to google cache?

+1


a source


Another approach is to use the HTML Help HH.EXE command line program to render specific pages or decompile a specific CHM into HTML files.

Go to the folder specified by Lunatik in the command window and enter the following command:

hh -decompile html vbaac10.chm
                      ^^
# ac is for Access; use xl for Excel, wd for Word, etc

      

This will create an "html" folder under it and fill it with most of the files that went into creating the CHM file. The resulting HTML files can be opened directly in your browser, although they will not find associated stylesheets or scripts that are addressed by their locations in the CHM files. The stylesheets and scripts are retrieved, although you can work with them as well.

Also check out the XML files in folder 1033, for example VB_ACTOC.XML is the table of contents for the Access VBA reference. It contains theme nodes with labels and URLs for each item in the help file:

<topic>
  <label>CheckBox Object</label>
  <url>mk:@MSITStore:vbaac10.chm::/html/acobjCheckBox.htm</url>
</topic>

      



The mk: etc ... url can be placed on the HH command line to open this topic in a normal HTML help window. Also, it shows the original CHM file name and relative file path when decompiled.

hh mk:@MSITStore:vbaac10.chm::/html/acobjCheckBox.htm

      

With these files, you can put together a script to find / grep files by keywords and show them in the browser, or you can remap the files to some kind of database or other search facility to work with the SciTe help based command.

Some sites with more information on using HH.EXE:

  • Command Line HTMLHelp

    HH command line tips and links to other sites

  • KeyHH 1.1

    alternative / additional program for HH.EXE for working with CHM files

+2


a source


Inspired mainly by Sleepwalker, adding:

command.help.$(file.patterns.vb)=http://www.google.co.uk/search?hl=en&newwindow=1&q=site%3Amsdn.microsoft.com+%222003+VBA%22+$(CurrentWord)
command.help.subsystem.$(file.patterns.vb)=2

      

to my vb.properties file gives me a reasonable job (loads google search results page with search criteria:

site:msdn.microsoft.com "2003 VBA" $(CurrentWord)

      

Obviously there is no guarantee that this will lead me to a useful page, but then the built-in help in the VBA editor isn't all that reliable on that ...

Could someone who knows SciTe better suggest a more elegant solution?

+1


a source







All Articles