I
ITWeiHan
Guest
My Question:
I know onenote rest web api can do it,but i hope using pc client libary.(More Faster)
Is there any lib can export onenote page to html file ?
Example I tried:
1.create a page :
2.I try using ScipBe.Common.Office.OneNote libary then i get xml-format content
void Main()
{
var oneNoteProvider = new OneNoteProvider();
var pageitems = oneNoteProvider.PageItems.Where(p => p.Name =="TEST");
foreach (var item in pageitems)
{
var pageXMLContent = "";
oneNoteProvider.OneNote.GetPageContent(item.ID, out pageXMLContent, Microsoft.Office.Interop.OneNote.PageInfo.piBasic);
pageXMLContent.Dump($"{item.LastModified} {item.Notebook.Name} {item.Section.Name} {item.Name} {item.DateTime}");
}
}
Query Content Result:
<one:OE authorResolutionID="<resolutionId provider="Windows Live"" creationTime="2018-08-04T02:07:48.000Z" lastModifiedTime="2018-08-04T02:07:48.000Z" objectID="{CC124B54-2D28-4926-ACFB-755E228E3087}{51}{B0}" alignment="left" quickStyleIndex="1">
<one:T>
<![CDATA[]]>
</one:T>
<one:OEChildren lang="en-US">
<one:OE creationTime="2018-08-04T02:08:07.000Z" lastModifiedTime="2018-08-04T02:08:07.000Z" objectID="{CC124B54-2D28-4926-ACFB-755E228E3087}{16}{B0}" alignment="left" quickStyleIndex="1" style="font-family:'Microsoft JhengHei';font-size:18.0pt">
<one:List>
<one:Number numberSequence="0" numberFormat="##." fontSize="18.0" font="Microsoft JhengHei" bold="true" text="1."/>
</one:List>
<one:T>
<![CDATA[<span style='font-weight:bold'>This is test Page</span>]]>
</one:T>
</one:OE>
</one:OEChildren>
</one:OE>
Expect Result:
<html xmlns="urn:schemas-microsoft-comfficeffice" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns="HTML 4.01 Specification">
<body lang=zh-TW style='font-family:Calibri;font-size:11.0pt'>
<div style='direction:ltr;border-width:100%'>
<div style='direction:ltr;margin-margin-width:6.8652in'>
<div style='direction:ltr;margin-margin-width:1.1743in'>
<p style='margin:0in;font-family:"Microsoft JhengHei";font-size:20.0pt' lang=en-US>TEST</p>
</div>
<div style='direction:ltr;margin-margin-width:6.8652in'>
<ul style='margin-left:.0312in;direction:ltr;unicode-bidi:embed;margin-top:
0in;margin-bottom:0in'>
<p style='margin:0in;font-family:Calibri;font-size:11.0pt'> </p>
<ol type=1 style='margin-left:.375in;direction:ltr;unicode-bidi:embed;
margin-top:0in;margin-bottom:0in;font-family:"Microsoft JhengHei";font-size:
18.0pt;font-weight:bold;font-style:normal'>
<li value=1 style='margin-top:0;margin-bottom:0;vertical-align:middle;
font-weight:bold' lang=en-US>
<span style='font-family:"Microsoft JhengHei";
font-size:18.0pt;font-weight:bold;font-style:normal;font-weight:bold;
font-family:"Microsoft JhengHei";font-size:18.0pt'>This is test Page</span>
</li>
</ol>
<p style='margin:0in'>
<img src="OneNote.files/image001.png" width=652 height=110 alt="機器產生的替代文字: ,CHANGEDAFEWSECONDSAGO OneN0teExportpagetohtmlfile">
</p>
</ul>
</div>
</div>
</div>
</body>
</html>
Continue reading...
I know onenote rest web api can do it,but i hope using pc client libary.(More Faster)
Is there any lib can export onenote page to html file ?
Example I tried:
1.create a page :
2.I try using ScipBe.Common.Office.OneNote libary then i get xml-format content
void Main()
{
var oneNoteProvider = new OneNoteProvider();
var pageitems = oneNoteProvider.PageItems.Where(p => p.Name =="TEST");
foreach (var item in pageitems)
{
var pageXMLContent = "";
oneNoteProvider.OneNote.GetPageContent(item.ID, out pageXMLContent, Microsoft.Office.Interop.OneNote.PageInfo.piBasic);
pageXMLContent.Dump($"{item.LastModified} {item.Notebook.Name} {item.Section.Name} {item.Name} {item.DateTime}");
}
}
Query Content Result:
<one:OE authorResolutionID="<resolutionId provider="Windows Live"" creationTime="2018-08-04T02:07:48.000Z" lastModifiedTime="2018-08-04T02:07:48.000Z" objectID="{CC124B54-2D28-4926-ACFB-755E228E3087}{51}{B0}" alignment="left" quickStyleIndex="1">
<one:T>
<![CDATA[]]>
</one:T>
<one:OEChildren lang="en-US">
<one:OE creationTime="2018-08-04T02:08:07.000Z" lastModifiedTime="2018-08-04T02:08:07.000Z" objectID="{CC124B54-2D28-4926-ACFB-755E228E3087}{16}{B0}" alignment="left" quickStyleIndex="1" style="font-family:'Microsoft JhengHei';font-size:18.0pt">
<one:List>
<one:Number numberSequence="0" numberFormat="##." fontSize="18.0" font="Microsoft JhengHei" bold="true" text="1."/>
</one:List>
<one:T>
<![CDATA[<span style='font-weight:bold'>This is test Page</span>]]>
</one:T>
</one:OE>
</one:OEChildren>
</one:OE>
Expect Result:
<html xmlns="urn:schemas-microsoft-comfficeffice" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns="HTML 4.01 Specification">
<body lang=zh-TW style='font-family:Calibri;font-size:11.0pt'>
<div style='direction:ltr;border-width:100%'>
<div style='direction:ltr;margin-margin-width:6.8652in'>
<div style='direction:ltr;margin-margin-width:1.1743in'>
<p style='margin:0in;font-family:"Microsoft JhengHei";font-size:20.0pt' lang=en-US>TEST</p>
</div>
<div style='direction:ltr;margin-margin-width:6.8652in'>
<ul style='margin-left:.0312in;direction:ltr;unicode-bidi:embed;margin-top:
0in;margin-bottom:0in'>
<p style='margin:0in;font-family:Calibri;font-size:11.0pt'> </p>
<ol type=1 style='margin-left:.375in;direction:ltr;unicode-bidi:embed;
margin-top:0in;margin-bottom:0in;font-family:"Microsoft JhengHei";font-size:
18.0pt;font-weight:bold;font-style:normal'>
<li value=1 style='margin-top:0;margin-bottom:0;vertical-align:middle;
font-weight:bold' lang=en-US>
<span style='font-family:"Microsoft JhengHei";
font-size:18.0pt;font-weight:bold;font-style:normal;font-weight:bold;
font-family:"Microsoft JhengHei";font-size:18.0pt'>This is test Page</span>
</li>
</ol>
<p style='margin:0in'>
<img src="OneNote.files/image001.png" width=652 height=110 alt="機器產生的替代文字: ,CHANGEDAFEWSECONDSAGO OneN0teExportpagetohtmlfile">
</p>
</ul>
</div>
</div>
</div>
</body>
</html>
Continue reading...