Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to properly show text for URL link using RichTextBox to output into RTF format?

How to properly show text for URL link using RichTextBox to output into RTF format?

Scheduled Pinned Locked Moved C#
helpvisual-studiotutorialquestionannouncement
1 Posts 1 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jboyd111
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups