Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/clojure/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何使用C在现有MS onenote页上插入文本行#_C#_Onenote - Fatal编程技术网

C# 如何使用C在现有MS onenote页上插入文本行#

C# 如何使用C在现有MS onenote页上插入文本行#,c#,onenote,C#,Onenote,我想使用C#将行添加到onenote页面。 创建页面的步骤是已知的,但在现有onenote页面上找不到插入行的步骤 我想你说的是OneNote REST API。要向OneNote中的现有页面添加文本行,可以使用修补程序API。 以下是官方文件的链接: 您的请求应该如下所示: PATCH ~/me/notes/pages/{PAGEID} Content-Type: application/json Body: [ { "target":"body", "action":"appen

我想使用C#将行添加到onenote页面。
创建页面的步骤是已知的,但在现有onenote页面上找不到插入行的步骤

我想你说的是OneNote REST API。要向OneNote中的现有页面添加文本行,可以使用修补程序API。 以下是官方文件的链接:

您的请求应该如下所示:

PATCH ~/me/notes/pages/{PAGEID}
Content-Type: application/json
Body:
[
{
   "target":"body",
   "action":"append",
   "position":"after",
   "content":"MySentenceHtmlContent"
}
]
如果你有任何问题,请告诉我!
Jorge

我想你说的是OneNote REST API。要向OneNote中的现有页面添加文本行,可以使用修补程序API。 以下是官方文件的链接:

您的请求应该如下所示:

PATCH ~/me/notes/pages/{PAGEID}
Content-Type: application/json
Body:
[
{
   "target":"body",
   "action":"append",
   "position":"after",
   "content":"MySentenceHtmlContent"
}
]
如果你有任何问题,请告诉我!
Jorge

我有一个在现有OneNote页面中插入文本行的解决方案。 使用XML格式,如下所示

    public static string SetPageContent(string pageId, string msg)
    {
        string xml;
        onenoteApp.GetPageContent(pageId, out xml, PageInfo.piAll);
        var doc = XDocument.Parse(xml);

        // make newline with msg input
        XElement text = new XElement(ns + "OE",
            new XElement(ns + "T",
                new XCData(msg)));

        // insert new line
        doc.Root.Element(ns + "Outline").Element(ns + "OEChildren").Add(text);

        // Now update the page content
        onenoteApp.UpdatePageContent(doc.ToString());

        return null;
    }

我有一个在现有OneNote页面中插入文本行的解决方案。 使用XML格式,如下所示

    public static string SetPageContent(string pageId, string msg)
    {
        string xml;
        onenoteApp.GetPageContent(pageId, out xml, PageInfo.piAll);
        var doc = XDocument.Parse(xml);

        // make newline with msg input
        XElement text = new XElement(ns + "OE",
            new XElement(ns + "T",
                new XCData(msg)));

        // insert new line
        doc.Root.Element(ns + "Outline").Element(ns + "OEChildren").Add(text);

        // Now update the page content
        onenoteApp.UpdatePageContent(doc.ToString());

        return null;
    }

您正在使用OneNote REST API吗?()还是COM API?我不知道OneNote REST API。我试着把线插入到OnEnoad的XML格式中。如果你的应用程序在本地工作,你可以考虑使用OnEnOut-REST API吗?()还是COM API?我不知道OneNote REST API。我尝试将线条插入到OnEnoad的XML格式。如果您的应用程序在本地工作,您可以认为您的建议表单对我来说是新的。这是C#吗?这是一个可以用C#完成的HTTP请求。我建议使用OneNote API签出windows应用商店示例。您建议的表单对我来说是新的。这是C#吗?这是一个可以用C#完成的HTTP请求。我建议使用OneNote API查看windows应用商店示例