Opening Modal Forms and Custom Help

S

Sanjay Singh

I want to open a modal form for an Outlook Com Addin that I have written
with VB. Form works as expected.

I have also written a custom Help file (hlp format). If the user presses F1
on the form then the Help file is displayed BUT then Outlook also opens its
help file and hides my custom help file. Is there anything that I need to do
to tell Outlook to NOT display its help file.

Funny thing is that Help works as expected if I open the form in non-modal
mode.

(I am opening the form in Modal mode as it relates to the Inspector that it
is opened from and I want the user to either finish what he is doing or
close the form to return to the inspector ... I understand that modal forms
are not recommended with com addins. Is there anyway I can achieve what I
want with a non-modal form i.e.
Form will be displayed on top of the inspector
User will not be able to go to the inspector without closing the form
)

Thanks in advance
Sanjay
 
K

Ken Slovak - [MVP - Outlook]

Yeah, that's a bug when you call Help. To workaround it use something like
this:

Private Sub cmdHelp_Click()
On Error Resume Next

SendKeys "{F1}", False
End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Dim iRetCode As Long

On Error Resume Next

If KeyCode = vbKeyF1 Then
iRetCode = HtmlHelp(0, g_strWinDir, HH_HELP_CONTEXT, 1070)
End If
End Sub

In this case g_strWinDir is where the Help file is located and 1070 is the
context for that form in the Help file.
 
G

Guest

i do not understand what you mean . i need a objective for my resume my words sound terrible
 
S

Sanjay Singh

I tried that but the F1 help request still seems to reach Outlook that then
displays its own help file. I tried setting KeyCode=0 but this still did not
help.

Sanjay
 
K

Ken Slovak - [MVP - Outlook]

Excuse me? Are you referring to my answer to the previous question? Please
be clearer if you are.




mel said:
i do not understand what you mean . i need a objective for my resume my
words sound terrible
 
K

Ken Slovak - [MVP - Outlook]

Did you set App.Help in your initialization code? Do you have a code module
with all the necessary HTML Help declarations? Should look something like
this:

g_strWinDir = g_strLocalSavePath & "\remindermanager.chm"
App.HelpFile = g_strWinDir


Declare Function HtmlHelp Lib "hhctrl.ocx" Alias "HtmlHelpA" _
(ByVal hwndCaller As Long, ByVal pszFile As String, _
ByVal uCommand As Long, ByVal dwData As Long) As Long

Public Const HH_DISPLAY_TOPIC = &H0
Public Const HH_SET_WIN_TYPE = &H4
Public Const HH_GET_WIN_TYPE = &H5
Public Const HH_GET_WIN_HANDLE = &H6

' Display string resource ID or text in a pop-up window.
Public Const HH_DISPLAY_TEXT_POPUP = &HE

' Display mapped numeric value in dwData.
Public Const HH_HELP_CONTEXT = &HF

' Text pop-up help, similar to WinHelp's HELP_CONTEXTMENU.
Public Const HH_TP_HELP_CONTEXTMENU = &H10

' text pop-up help, similar to WinHelp's HELP_WM_HELP
Public Const HH_TP_HELP_WM_HELP = &H11
 
S

Sanjay Singh

Hi Ken

Thank you for your help.

I am using WinHelp (not HTML Help).

I set the applications HelpFile property using the VB IDE i.e. by looking at
the properties of the project.

The problem is not in displaying my help file - that displays fine. The
problem is that irrespective of what I do the F1 key gets passed to Outlook
after my Com Addin displays its help.

There must be something small that I am missing.

Help
Sanjay
 
K

Ken Slovak - [MVP - Outlook]

I can't help because I never use WinHelp.

Using HTML Help I've seen the same things and the workarounds I showed
prevent the problem. I have no idea if there are other workarounds for
WinHelp that might get rid of the problem or if you just have to live with
it. Why use WinHelp though? It's very obsolete.

The only thing I can suggest is posting your questions in one of the Help
newsgroups, where the people there may be more familiar with the problem and
any solutions for WinHelp.
 
S

Sanjay Singh

Firstly, thank you for all the time you have given in answering my
questions.

My reasons for using Win Help are:

Office 2000 applications do not support HTML help files properly. That is
one of the reasons I chose WinHelp but even that is now giving problems with
Outlook.

I am also using a good free tool to create WinHelp files. At this stage I
don't do enough Help file writing to invest in a full Help program.

Are you aware of any free (or not so expensive) html help writers that
support id numbers that can be used to create context sensitive help.

Thanks
Sanjay
 
K

Ken Slovak - [MVP - Outlook]

I'm not sure what the limitations are for supporting HTML Help for Office
2000 but I use it for my COM addins and those all run on Outlook 2000 and
later without any problems. In fact I see no difference in how the Help
works in Outlook 2000 or 2002 or 2003.

I use the free HTML Help editor/compiler that MS supplies. It's called the
HTML Help Workshop. It supports id's for context sensitive help, table of
contents, indexes and all the other goodies. You can do all that within the
Help editor but I also use Notepad to work with the files very often since
in some cases it's easier to work with adding aliases and id's and CSS
styles to the Help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top