Search for the .chm file to see if a topic identifier exists before opening a request

I wrote a simple class (both C # and VB.net) that asks for the opening of the chm file when the user presses F1. Is there a way to check if a specific topic id exists before I make a request to open a file?

Currently, if the topic identifier does not exist, the file does not even try to open, and the user does not receive a response when pressing F1. I would prefer if the topic identifier did not exist, this meant that the chm file was still opening, but was in the table of contents.

try
{
    Help.ShowHelp(ctlparent, filename, HelpNavigator.TopicId, topic);
}
catch
{
    Help.ShowHelp(ctlparent, filename, HelpNavigator.TableOfContents);
}
+5
source share

All Articles