简体   繁体   English

将OneNote(.one)格式转换为RichTextBox(RTF)C#

[英]OneNote (.one) format to RichTextBox (RTF) C#

I need help with one problem. 我需要一个问题的帮助。 I have to take the text from OneNote file in Clipboard or with some other shortcut or with one mouse click and insert it to RichTextBox in Visual Studio. 我必须从剪贴板中的OneNote文件或其他快捷方式或单击鼠标中获取文本,然后将其插入Visual Studio中的RichTextBox。

Only problem is that if I copy the text to RichTexBox, there is a special frame left in RichTexBox Window, so i couldn't work with the text. 唯一的问题是,如果我将文本复制到RichTexBox中,则RichTexBox窗口中还有一个特殊的框架,因此我无法处理文本。 This frame is a note from OneNote file, because if you want to contribute to OneNote file, you have to insert this note and there is no other possibility how to write a text, am I right? 该框架是OneNote文件中的便笺,因为如果您想为OneNote文件做出贡献,则必须插入此便笺,并且没有其他可能的方式编写文本,对吗?

This problem could be solved by copying to MS Word (the frame disappears) and after that by using of a new copy of the text (from MS Word) and pasting it to RichTextBox in VS. 通过复制到MS Word(框架消失),然后使用文本的新副本(来自MS Word)并将其粘贴到VS中的RichTextBox,可以解决此问题。 I need to do that somehow in one step. 我需要一步一步地做到这一点。

Could you please give me some tips how to do that? 您能给我一些技巧吗? I need to work parse the text (rich text) in C# and convert it. 我需要在C#中解析文本(富文本)并将其转换。

PS: Sorry for my English. PS:对不起,我的英语。

If you want to parse text in .one file you can use Application Interface of Onenote. 如果要解析.one文件中的文本,则可以使用Onenote的应用程序界面。 By using this you can read the onenote page(XML output) and parse as you want. 通过使用此方法,您可以阅读onenote页面(XML输出)并根据需要进行解析。 Application Interface 2013 . 应用程序界面2013

Page content: http://pastebin.com/acgaBSe3 页面内容: http : //pastebin.com/acgaBSe3

Where Page is: 页面在哪里: 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM