Exemplo n.º 1
0
        public void Navigate(string pageId)
        {
            /*
             *  http://msdn.microsoft.com/en-us/library/gg649853(v=office.14).aspx
             *  bstrPageID: The OneNote ID of the page that contains the object to delete.
             *  bstrObjectID: The OneNote ID of the object that you want to delete.
             */
            bool success = onenoteApplication.TryNavigateTo(pageId);

            if (!success)
            {
                etc.LoggerHelper.LogWarn("Navigate failed. pageId:{0}", pageId);
            }
        }
 public bool TryNavigate(string pageId)
 {
     /*
      *  http://msdn.microsoft.com/en-us/library/gg649853(v=office.14).aspx
      *  bstrPageID: The OneNote ID of the page that contains the object to delete.
      *  bstrObjectID: The OneNote ID of the object that you want to delete.
      */
     if (CheckIfPageExists(pageId))
     {
         if (lastSelectedPageId == null || lastSelectedPageId != pageId)
         {
             lastSelectedPageId = pageId;
             if (onenoteApplication.TryNavigateTo(pageId))
             {
                 return(true);
             }
             else
             {
                 etc.LoggerHelper.LogWarn("Navigate failed. pageId:{0}", pageId); // not critical
             }
         }
     }
     return(false);
 }