有没有办法从命令行访问VBA帮助文件

发布于 2024-07-20 02:51:46 字数 249 浏览 4 评论 0原文

我必须为我正在从事的项目编写许多 vba 模块,并且更愿意使用 SciTe 而不是 Office 中的内置编辑器。

SciTe 允许您将按 F1 的效果重定向到任意命令,并将所选文本作为参数。 是否可以使用此功能来搜索相关的 .chm 文件?

我猜不会,因为 vba 的帮助分布在多个文件中,但我希望有人能证明我错了......

如果有人能提出一种方法来找出特定的 chm 文件,我特别感兴趣库帮助仅来自函数的完全分隔名称。

I'm going to have to write a number of vba modules for a project I'm working on, and would prefer to use SciTe to the built in editer in Office.

SciTe allows you to redirect the effect of hitting F1 to a arbitary command with the selected text as an argument. Is there anyway of using this functionality to search the relevant .chm files?

I'm guessing not, given that the help for vba is spread across multiple files, but I'm hoping someone can prove me wrong...

I'm especially interested if anyone can suggest a way to find out which chm file a particular libraries help resides, just from the fully delimitered name of the function.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

渡你暖光 2024-07-27 02:51:46

另一种方法是使用 HTML 帮助命令行程序 HH.EXE 来显示特定页面,或将特定 CHM 反编译为 HTML 文件。

在命令窗口中转到 Lunatik 提到的文件夹并输入以下命令:

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

这将在其下方创建一个“html”文件夹,并用创建 CHM 文件时所用的大部分文件填充该文件夹。 生成的 HTML 文件可以直接在浏览器中打开,尽管它们找不到相关的样式表或脚本(这些样式表或脚本是通过其在 CHM 文件中的位置来寻址的)。 不过,样式表和脚本确实会被提取,因此您也可以使用它们。

另请查看 1033 文件夹中的 XML 文件,例如 VB_ACTOC.XML - 这是 Access VBA 帮助的目录。 它包含带有标签的主题节点和帮助文件中每个项目的 url:

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

mk:etc... url 可以放在 HH 命令行上,以在常规 HTML 帮助窗口中打开该主题。 此外,它还显示源 CHM 文件名以及反编译时文件的相对路径。

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

利用这些文件,您可以编写一个脚本来按关键字查找/grep 文件并在浏览器中显示它们,或者您可以将文件重新设计为某种数据库或其他查找功能,以便与 SciTe 基于命令的帮助系统一起使用。

一些网站提供了有关使用 HH.EXE 的更多信息:

  • HTMLHelp 命令行

    有关使用 HH 命令行和其他站点链接的提示

  • KeyHH 1.1

    用于处理 CHM 文件的 HH.EXE 的替代/补充程序

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

Go to the folder mentioned by Lunatik in a command window and enter this command:

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

This will create an "html" folder below 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 won't find their related style sheets or scripts which are addressed by their locations in CHM files. The style sheets and scripts do get extracted though so you can work with them too.

Also take a look at the XML files in the 1033 folder like VB_ACTOC.XML - this is the Table of Contents for the Access VBA help. It contains topic 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 put on the HH command line to open that topic in a regular HTML Help window. Also, it shows the source CHM filename, and the relative path of the file when decompiled.

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

Working from these files, you could put together a script to find/grep files by keyword and show them in a browser, or you could reengineer the files into some sort of database or other lookup capability to work with SciTe's command based help system.

Some sites with more info about using HH.EXE:

  • HTMLHelp command-line

    tips on using the HH command line and links to other sites

  • KeyHH 1.1

    an alternate/supplemental program to HH.EXE for working with CHM files

江城子 2024-07-27 02:51:46

主要文件(无论如何对于 Office 2003)保存在 Program Files\OFFICE11\1033 中,但访问其中的页面可能有点棘手,因为 Microsoft 逐渐不得不控制深入研究 CHM 的能力出于安全考虑,这些年来的文件。
此页面 (download) 有一些关于链接到 CHM 内的特定页面仍然可能的好信息话

虽如此,我不认为该文件是当今大多数用户显示的默认帮助,但它已经足够接近了,大多数时候只缺少 Office 2007 的提示。 联机帮助似乎被设置为默认值,除非您在 Office 安装期间专门禁用它。 我认为这些 URL 对 SEO 不太友好,所以无法猜测。 我想你可以借用骗子的诡计,制作指向 Google 顶部链接的 URL,例如: 范围

编辑: Google 缓存链接?

The main files are held (for Office 2003 anyway) in Program Files\OFFICE11\1033, but accessing pages within them could be a bit tricky as Microsoft have gradually had to reign in the ability to delve into CHM files over the years due to security concerns.
This page (download) has some good info on what might still be possible as far as linking to specific pages inside a CHM

Having said that, I don't think this file is the default help shown to most users nowadays, but it's close enough, missing only the Office 2007 pimping most of the time. The online help seems to be set as default unless you specifically disable it during the Office install. The URLs are, I think, not very SEO friendly so couldn't be guessed. I suppose you could borrow a sneaky trick from scammers and craft URLs that point to the top link on Google, thusly: Range.

EDIT: Google cache link?

梦境 2024-07-27 02:51:46

受到 Lunatik 的回答的很大启发,添加:

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

到我的 vb.properties 文件给了我一个合理的解决方法(加载一个谷歌搜索结果页面,搜索条件为:

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

显然不能保证它会把我带到一个有用的页面,但随后的内联帮助VBA 编辑器在该编辑器上也不是那么可靠...

任何了解 SciTe 的人都可以更好地建议一种更优雅的解决方案吗?

Inspired heavily by Lunatik's answer, 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 work around (loads a Google search results page with search criteria of:

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

Obviously no guarantees of it taking me to a helpful page, but then the inline help in the VBA editer isn't all that reliable on that one either...

Can anyone who knows SciTe better suggest a more elegant solution?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文