How to properly show text for URL link using RichTextBox to output into RTF format?
-
All, I apologize if this has been answered somewhere in the forum already. I've searched for a couple of hours here and the general web and haven't found a suitable answer. I simply want to output an RTF file that contains hyperlinks (URL) but shows ONLY the text for that link, not both the text and the full URL. Here's brief code snippet that does NOT work as expected: richTextBox1.LoadFile(inputFile, RichTextBoxStreamType.RichText); richTextBox1.SaveFile(outputFile, RichTextBoxStreamType.RichText); This snippet simply reads in an RTF file into a RichTextBox control and saves it back out (This is not what I'm actually trying to do in the long run, I just wanted to isolate the issue for clarity). When I open the files in MS Word: The original file (inputFile) has the text: "Bug# 137". This text is a hyperlink and all you see is the text and you could click it and go to the corresponding web page. The "copied" version of the file contains the text: "Bug# 135 ". This text is blue, and is underlined. Yet there are 2 things wrong with it: 1) It lists the entire URL, not just the text ("Bug# 135") 2) It is not an actual link, just blue, underlined text. I'm using VS 2010. I have explicitly set "DetectURLs" boolean property, though I believe it's set to "true" by default. Any assistance with this "gnawing" issue would be greatly appreciated.