How do I insert a hyperlink into the text inside a TRichEdit control in Delphi?

Hello Experts,

What I want to do is to give the user the facility to insert a reference to a document in the middle of some free text - the reference is sensitive to 'MouseOver' and 'OnClick' events;

For example, the user will type "The company safety policy consists of " and then he/she will click a button to insert a reference at the last carat position. The text now reads..."The company safety policy consists of RIDORR Sections 1 to 5" where "RIDORR Sections 1 to 5" is the reference that is mouse-sensitive.

I want the reference to change colour when the mouse is hovering over it and when the user clicks on the reference I will call up another Form to display the content of the reference. To do all this requires first of all that the reference is somehow made mouse-sensitive. Added to this, the string that forms the reference has to act as a single character when it comes to deletion - the user will delete the whole string with a single 'backspace' keystroke, no partial deletion of the reference is allowed.

This looks very difficult hence the high tariff.

I would consider using a TMemo control instead of TRichEdit if that makes it easier.

Thanks in advance.
SteveFarndon2000Managing DirectorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I think that this link to will satisfy your need to have an RTF in a rich edit control.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SteveFarndon2000Managing DirectorAuthor Commented:
Dealt with the issue of creating a mouse-sensitive piece of text but not the requirement ot insert text at the carat position.
Would have prefered to reduce the points but can't see how to do this.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.