0

I am writing an add-in for OneNote with . 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.

Valuex
  • 104
  • 1
  • 10
  • What happens if you comment out the lines `this.Dispose(); this.Close()`? –  Oct 11 '20 at 02:45
  • It is the same. Actually I add those two lines is due to above mentioned error. But no lucky even added. – Valuex Oct 12 '20 at 11:39

0 Answers0