I am writing an add-in for OneNote with c#. It’s function is to navigate to certain page when double-click a node in treeview, which exhibits the structure of OneNote Notebook-Section-Pages hierarchy.
This is what I do:
private void treeView_NodeDbClick(object sender, TreeNodeMouseClickEventArgs e)
{
TreeNode SelectedNode = e.Node;
string SeletedNodeID = GetSeletedNodeID(SelectedNode).Last();
try
{
_oneNoteApp.NavigateTo(SeletedNodeID);
this.Dispose();
this.Close();
}
catch
{
MessageBox.Show("Failed to navigate!");
}
}
But when I double-click the node in the treeview. OneNote appears to get "stuck" whilst the OneNote process in Task Manager says:
not responding.
Any solution for this problem? It would be highly appreciated.