OneNote (.one) format to RichTextBox (RTF) C# - 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.
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. 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?
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. 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.
P.S.: Sorry for my English.

If you want to parse text in .one file you can use Application Interface of Onenote. By using this you can read the onenote page(XML output) and parse as you want. Application Interface 2013.
Page content:
http://pastebin.com/acgaBSe3
Where Page is:

Related

C# Copying and pasting code with related formatting details

Looking for away to copy and paste my code form Visual studio to a word document with code formatting e.g. different colours for key words etc.
Is there also a way to directly output your selected code into a pdf file?
You can do that using pspad program. Export it to the .rtf then open in MS Word and save as .pdf.
It will stay colored.
UPDATE
But when I tried it now, it will stay colored, but. public void for example is black bold (I would say) instead of blue. I think you can work around that.
Managed to find a solution to my own problem.
1)Use notepad++, copy and paste code from VS, select the coding language you are using from "Language"
2)then highlight all the code you want to copy with formatting in notepad++
3)Plugins -> Nppexport -> copy RTF to clipboard
then paste code where ever you want, should paste with formatting

Edit Word template in C#

I'm stuck in a project for school.
I have a word template, this is a empty document but it has some formatting, for example, each page has 25 lines, the font is Times New Roman and its size 12.
What I have to do is to open this template, write information and save it. When I open the template I should see the text displayed respecting the format.
How can I do this? I tried DocX library but I couldn't make work Line Spacing feature.
You can user whatever you want to make it work. It must be in C#.
Does it need to be C#? Maybe they want you to use vba?

How to search string and highlight the searched strings in the Document

Hai,
We are presently working on C# windows Application using
Janus Controls.
In that we have a search functionality like, if you search any word in search box, all the documents(it's my be Notepad,Ms-word,PDF)
which contains that searched word should be displayed in the
application.
when we Double click on the any document it should open a new window like popup
and show preview like what word you have searched and the searched
word should be highlighted with some color as like in our Microsoft
Word Document.
we can open the particular document using word or Pdf and highlight
the text. But we need to open it in one window and show all the
matched searched text in highlighted.
Please provide the possible Solution or link to work with or any tools to work with this scenario.
Thank you.
For including the documents from the system , you need to first include that document in the project either in the program or you can do it while creating the project . Then you need to open the file and read with the help of StreamReader and search for the particular word .

How to embed ms word into winform

i need to know the ways of embedding ms word with limited controls in winform . and also i want to insert some headers and footers in to the ms word. Found some articles which depicts only embedding the controls inside the winform . So my question is how to generate a document file and limit the controls of msword inside the winform . Anyone help me.
I don't believe this is possible.
What you could do however would be place a rich text field onto the screen and save the content into a .doc format - which you could make available for download or submission.
EDIT: question referrred to winforms. This can be done use standard rtf in the rich text box.
link to a tutorial on rtf tables - http://www.devx.com/asp/Article/17964/0/page/3

Mimic Excel Text Import wizard in Winforms

I have a requirement to paste the clipboard data to a textbox and split the data into columns as what we can do in Excel Text Import wizard.
Can anybody suggest me a starting point to get hold of this?
an idea can be put each character of first line of the text in many TextBox control which created and arranged horizontally in a windows form so an user can separate line by clicking on each text box to show the breaking points
I've found some old CPP code for a control here:
http://www.codeproject.com/KB/miscctrl/separator_ctrl.aspx
I'm still trying to find an updated version for .NET. (I'm not sure I have the time to try to convert this, myself.)

Categories

Resources