LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default How to get TOC shown in HTML Help when calling from VBA?

Luckily, there are two good (and free-of-charge) installers available for
Windows:

NSIS (from the NullSoft guys, who have written WinAmp)
[ http://nsis.sourceforge.net/Main_Page ]

InnoSetup (I've used it extensively in the past, and it's rock stable)
[ www.jrsoftware.org/isinfo.php ]

Good luck,
/MP

"Tom Ogilvy" wrote:

The workbook created from a template file has no knowledge of the location
of the template or any other association with it. In fact, if a template
has a workbook_open event, to avoid having the code run when the template is
edited, people add code to check if the workbook has a path - if it doesn't
they know it is not the template being opened but a workbook created from
the template.

Sounds like you need to distribute your program with an install routine.

--
Regards,
Tom Ogilvy

"myunker" wrote in message
...
Thanks Mat - that did the trick.

Additional issue now arises. My Excel spreadsheets are templates that I

am
producing for some elementary school teachers. I KNOW they will simply

put
these templates on some given disk on their system (e.g. their local

account)
rather than in the templates directory. In so doing, when the template

is
opened I don't see how I can determine where the original template

location
was so that I can access the Help file. I can do a "file search " of

course,
but depending on their server setup that could take hours to complete.

Any idea on how to determine where the template file was located? That

way
the "new" workbook can find where the Help file was also installed and I

can
then save the help file along with the new file. As it stands now the new
workbook tries to get the help file from "C:\" since it hasn't been saved
anywhere.

thanks


"Mat P:son" wrote:

Instead of using the Application.Help method you can call the proper

HTML Help:

==========================

' Used for the HtmlHelp() Win32 function
Private Const HhDisplayTopic As Long = &H0
Private Const HhHelpContext As Long = &HF

' Names on the HTML Help file and the HTML Help window
' TODO: Fill in your own names here!!!
Private Const XlHelpFile As String = "\XlAddIn.chm"
Private Const XlHelpWin As String = "Main"
Private Const XlHelpEntry As String = "Welcome.htm"

' The function declaration for HTML Help
' TODO: HHCtrl.ocx should already be present on all systems except
' perhaps some old NT4 boxes. Install HTML Help if/when required!
Private Declare Function HtmlHelp Lib "hhctrl.ocx" Alias "HtmlHelpA" ( _
ByVal hwndCaller As Long, _
ByVal pszFile As String, _
ByVal uCommand As Long, _
dwData As Any) As Long

....

Private Sub ShowHtmlHelp()
' Show HTML Help for the add-in: the CHM file should be located
' in the same folder as the add-in, and we're opening the home page
Dim lResult As Long
lResult = HtmlHelp( _
0, _
ThisWorkbook.Path & XlHelpFile & "" & XlHelpWin, _
HhDisplayTopic, _
ByVal XlHelpEntry)

If lResult = 0 Then
' Handle the error...
End If
End Sub

==========================

"myunker" wrote:

I have built a Help file using HTML Help Workshop (.chm file). When I

call
the file from VBA (application.help filename) all I see is my default

page.
There is no TOC, or search, or any other options that I see if I

simply open
the .chm file by itself.
Any help would be appreciated.




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling VBA code from html or javascript Brent E Excel Discussion (Misc queries) 0 October 16th 08 11:27 PM
Convert 29.08 hours (shown in decimal form) to time shown in "hh:m Nila in Florida Excel Worksheet Functions 1 September 14th 08 01:35 AM
Column of Text Shown = Total Times Shown? philcassell Excel Worksheet Functions 3 July 19th 06 07:24 AM
Named Ranges shown (or not shown) as blue means what? wdeleo Excel Worksheet Functions 0 July 8th 05 01:40 PM
Calling HTML Source code from within VBA for Excel Peter Dickson Excel Programming 0 July 9th 03 08:38 PM


All times are GMT +1. The time now is 12:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"