我知道 onenote rest web api 可以做到,但我希望使用 pc 客户端库。(更快)
是否有任何库可以将 onenote 页面导出到 html 文件?
1.创建一个页面:
2.我尝试使用ScipBe.Common.Office.OneNotelibary 然后我得到 xml 格式的内容
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}");
}
}
查询内容结果:
<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>
<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>
冉冉说
相关分类