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 .
Related
Is there a way to paste a particular word document's contents into any winforms controls? I need the exact formatting of the word document along with any printscreens it has.
I don't believe there is any Visual Studio native control to achieve what you want to do. The RichText Box will not provide 100% formatting.
In this case you will have to find a 3rd party control.
The following is free and you have the sourcecode but it looks a bit old:
https://www.codeproject.com/articles/3582/word-control-for-net
A quick google search yielded these products.
https://www.devexpress.com/products/net/controls/winforms/rich_editor/
https://marketplace.visualstudio.com/items?itemName=NevronSoftware.RichTextEditorforWinForms-12056
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:
I am trying to highlight a word(e.g. a custom search function) in an open word document.
I'd like to know if I can make it happen by single clicking the word.
You can format text using a document-level customization. Read this article
I'm trying to write C# code to Copy-Paste charts from Excel and use Paste Link in MS Word, because with Excel, when you use Paste Link for the tables, text, charts, etc. I can click update all fields in Word after you change anything in Excel.
I was trying to use OpenXML to add content controls in Word and paste the charts to those spots, like what this blogger does.
http://www.dotblogs.com.tw/angus/archive/2010/05/19/15332.aspx
I added content control of the type "pictures" for each chart and they were successfully pasted in but not as links. Thus when I click "update links now" in Word after Excel data change, the charts in Word stay the same.
Maybe I didn't add the right type of content control? I don't know which type I should use for links.
Could any one point me to some source code or even a software?
Have a look here:
VBA: How to Programmatically Insert an Excel Chart into Word.
C#: Automating Word Tables for Data Insertion and Extraction
The magic does PasteSpecial method and its input parameter: Link set to True ;)
For further information, please see: Link or embed an Excel worksheet
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