以编程方式将OneNote部分转换为XPS

问题描述 投票:1回答:1

我需要一种以编程方式将OneNote分区文件(.one)转换为XPS格式的方法。我知道它如何用于Excel和Word,但是Interop.OneNote不同。

xps onenote
1个回答
0
投票

您将使用Publish功能(http://msdn.microsoft.com/en-us/library/gg649853.aspx),例如:

using Microsoft.Office.Interop.Onenote;

...

Application onApp = new Application();
string sectionid = "your section id here..."; //could also be a page or notebook id
string path = "your filepath here..."; //e.g. C:\Users\MyUsername\Documents\hi.xps
onApp.Publish(sectionid, path, PublishFormat.pfXPS);
© www.soinside.com 2019 - 2024. All rights reserved.