Quantcast
Channel: General Office Development forum
Viewing all articles
Browse latest Browse all 2257

OneNote : Need to update Current page/Section/view footer before printing.

$
0
0

Below code is allowing me to put text at the end of the document but at the cursor location. I want to update footer of the page. Can you help me on this /

 private string SetCurrentPageFooter(string footerValue)
       {
           // Create the new page
           string pageId = onApp.Windows.CurrentWindow.CurrentPageId;
          // onApp.CreateNewPage(sectionId, out pageId, NewPageStyle.npsBlankPageWithTitle);
           // Get the title and set it to our page name
           string xml;
           onApp.GetPageContent(pageId, out xml, PageInfo.piAll);
           var doc = XDocument.Parse(xml);
           var footer = doc.Descendants(ns + "T").Last();
           footer.Value = footerValue;
           //onApp.GetSpecialLocation(
           // Update the page
           onApp.UpdatePageContent(doc.ToString());
           return pageId;
       }


Viewing all articles
Browse latest Browse all 2257

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>