OnHelp Event

OnHelp Event

GeorgK
Advisor Advisor
513 Views
7 Replies
Message 1 of 8

OnHelp Event

GeorgK
Advisor
Advisor

Hello together,

 

how could I open a given site in a chm-file? I have for example a chm-file in "C:\Tem\Help.chm" in which I would like to open the site "index.htm".

 

To open the file:

 

 Process.Start("C:\Temp\Help.chm")

Thanks

 

Georg

0 Likes
Accepted solutions (1)
514 Views
7 Replies
Replies (7)
Message 2 of 8

Jef_E
Collaborator
Collaborator

Hi!

 

I'm also interested in this topic. Sadly I don't know the anwser.. How did you create the CHM file?



Please kudo if this post was helpfull
Please accept as solution if your problem was solved

Inventor 2014 SP2
0 Likes
Message 3 of 8

GeorgK
Advisor
Advisor

I create the chm-files with "HTML Help Workshop". You need some knowledge about HTML or a program to create the htm/html-files which are used in "HTML Help Workshop".

0 Likes
Message 4 of 8

GeorgK
Advisor
Advisor

Why does the OnHelp Event run the normal help-file from inventor as well as the chm-file?

0 Likes
Message 5 of 8

wayne.brill
Collaborator
Collaborator

Hi Georg,

 

Does the suggestion from this post help?


http://forums.autodesk.com/t5/inventor-customization/helpmanager-helpevents-property/td-p/3509668

 

>> >>

Add the following line  just after the call help.htm:
HandlingCode = HandlingCodeEnum.kEventHandled
Then Inventor will know that you have already handled this event.

<< <<

 

Thanks,

Wayne



Wayne Brill
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 6 of 8

GeorgK
Advisor
Advisor

Hello Wayne,

 

with the code I could solve the problem with the normal help-file from inventor. It runs only my chm-file. But how to run a special page in my chm-file without the HelpProvider?

 

Thanks

 

Georg

0 Likes
Message 7 of 8

wayne.brill
Collaborator
Collaborator
Accepted solution

Hi Georg,

 

I have not worked much with custom help. I did find this from an old case. Maybe it could be used as a guide. 

 

When I run this VBA code it does open the chm file but it does not open to the topic. Can you try it with one of your .htm locations in your chm file?

 

>> >>

When providing a valid absolute path, “DisplayHelpTopic” is working as expected, I used the 2011 help in order to test your example:


Sub DisplayCreateInPlaceHelp()

Dim filename As String

filename = "C:\Program Files (x86)\Autodesk\Autodesk Vault 2016 SDK\docs\VaultSDK.chm"

If (Not FileExists(filename)) Then
Exit Sub
End If

 

Dim topic As String
topic = "/WS1a9193826455f5ff5f7e8f111d48518712e24-reference.htm"

 

Dim HelpManager As HelpManager
Set HelpManager = ThisApplication.HelpManager

Call HelpManager.DisplayHelpTopic(filename, topic)

End Sub

 

Private Function FileExists(file As String) As Boolean
On Error GoTo Error
'get the file attributes, and make sure what
'is being passed isnt a directory
FileExists = (GetAttr(file) And vbDirectory) = 0
Exit Function
Error:
FileExists = False
End Function

<< <<

 

Thanks,

Wayne



Wayne Brill
Developer Technical Services
Autodesk Developer Network

Message 8 of 8

GeorgK
Advisor
Advisor

Hello Wayne,

 

the code is working very well.

 

Thank you Georg

0 Likes