Link to home
Start Free TrialLog in
Avatar of RonaldBiemans
RonaldBiemans

asked on

richtext url with spaces

I have a richtextbox with detecturl true.

I want to add file link to that richtextbox, this is no problem aslong as the filename or directory name doesn't include spaces

does anybody know if it is possible to do this if the name does include spaces
ASKER CERTIFIED SOLUTION
Avatar of arif_eqbal
arif_eqbal

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RonaldBiemans
RonaldBiemans

ASKER

That doesn't work, but it gave me an idea on how to make it work, so I'll give you the points
So what Idea you came up with???
It might Help Others...

Arif_eqbal, You are right. I just replaced the space with another character and then replaced it back when I call the e.linktext, like

Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click
        OFD1.ShowDialog()
        RichTextBox1.AppendText(OFD1.FileName.Replace(" ", "%"))
    End Sub

Private Sub RichTextBox1_LinkClicked(ByVal sender As Object, ByVal e As System.Windows.Forms.LinkClickedEventArgs) Handles RichTextBox1.LinkClicked
        System.Diagnostics.Process.Start(e.LinkText.Replace("%", " "))
    End Sub