Ejemplo n.º 1
0
        /// <summary>
        /// Send id in index, open requested page.
        /// </summary>
        /// <param name="id"></param>
        public void OpenPage(string id)
        {
            var pageId   = id.Split(' ')[1];
            var objectId = id.Split(' ')[0];

            oneNote.NavigateTo(pageId, objectId);
        }
Ejemplo n.º 2
0
 private bool NavigateTo(string ID)
 {
     try
     {
         OneNote.Application oneApp = new OneNote.Application();
         oneApp.NavigateTo(ID, null, false);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Ejemplo n.º 3
0
        internal void InsertImageIntoPage(OneNotePage page, string imageFilePath, string publishUrl, bool addTitle = false)
        {
            string xmlToInsert = _oneNoteXml.GetInsertSnipXml(page, GetBase64ImageString(imageFilePath), publishUrl, addTitle);

            _oneNoteApp.UpdatePageContent(xmlToInsert, System.DateTime.MinValue, _oneNoteXmlSchema);

            // navigate to inserted Snip
            string pageContentXmlAfterInsert;

            _oneNoteApp.GetPageContent(page.Id, out pageContentXmlAfterInsert, OneNote.PageInfo.piBasic, _oneNoteXmlSchema);

            string insertedSnipObjectId = _oneNoteXml.GetInsertedSnipObjectId(pageContentXmlAfterInsert);

            _oneNoteApp.NavigateTo(page.Id, insertedSnipObjectId);
        }
Ejemplo n.º 4
0
 private bool NavigateTo(string ID)
 {
     try
     {
         OneNote.Application oneApp = new OneNote.Application();
         oneApp.NavigateTo(ID, null, false);
         return true;
     }
     catch
     {
         return false;
     }
 }