Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom MSHTML link insert?

Status
Not open for further replies.

steverbs

Programmer
Jul 17, 2003
253
GB
Hi all.

I am modifying a CMS app for a client and need to know if, using JavaScript and the MSHTML WYSIWYG editor, it would be possible to write some code to allow my client to highlight a piece of text in the MSHTML iFrame box and select a link from a listbox to be applied to the selected piece of text?

Any help is greatly appreciated.

Regards.

Stephen.
 

I just don't know what you mean by MSHTML WYSIWYG editor. Are you referring "designMode" maybe? I can only imagine you are. Using Javascript, you can indeed get a "pointer" to a selection, and then choose a link from a listbox (which could modify the selection contents/style etc).

Look into using execCommand() (to update the style of a selection etc) and createRange() (to modify the selected range contents).

Hopefully this is enough to get you started. I can't really offer much more help without more specifics from you.

Jeff
 
I have just typed that stuff into MSDN and it looks like you've got me on the right track. I should be able to cover it from here.

Thanks for the help.

Stephen.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top