<?xml version="1.0" encoding="iso-8859-1" ?>
<rss version="2.0">
  <channel>
    <title>HtmlEditor</title>
    <link>http://www.itwriting.com/phorum/list.php?3</link>
    <description><![CDATA[For discussion of the .Net HTMLEditor control]]></description>
    <language>EN</language>
    <pubDate>Sun, 15 Oct 2006 17:39:30 +0100</pubDate>
    <lastBuildDate>Sun, 15 Oct 2006 17:39:30 +0100</lastBuildDate>
    <category>HtmlEditor</category>
    <generator>Phorum 5.1.25</generator>
    <ttl>60</ttl>
    <item>
      <title>Selecting an element failed when the cursor is on free text (on the body)</title>
      <link>http://www.itwriting.com/phorum/read.php?3,3372,3372#msg-3372</link>
      <author>liorklain</author>
      <description><![CDATA[I use external list of my objects (Html Elements) to select html elements in <br />
the htmleditor, when other element selected already i successed but when a text is selected this code is failed:<br />
<br />
            HtmlSelection selection = this.Document.selection;<br />
            HtmlControlRange range;<br />
            <br />
            try<br />
            {                                                <br />
                    // get selection range<br />
                    range = (HtmlControlRange)selection.createRange();<br />
                    <br />
                    // if item is already selected return from selection<br />
                    if ((range != null) &amp;&amp; (range.length &gt; 0))<br />
                    {<br />
                        if (range.item(0) == htmlElement)<br />
                        {<br />
                            return;<br />
                        }<br />
                    }<br />
<br />
                    // clear all selected items<br />
                    while (range.length &gt; 0)<br />
                    {<br />
                        range.remove(0);<br />
                    }<br />
<br />
                    // add selected element to the range of selection<br />
                    range.add(htmlElement as IHTMLControlElement);<br />
<br />
<br />
                    // set the range to be selected<br />
                    range.select();<br />
                    range.scrollIntoView(null);<br />
                                                                  <br />
            }<br />
            catch (Exception ex)<br />
            {<br />
               Debug.Write(ex.Message);<br />
            }            <br />
<br />
<br />
can somebody help me?<br />
<br />
thank you, lior]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,3372,3372#msg-3372</guid>
      <pubDate>Sun, 15 Oct 2006 17:39:30 +0100</pubDate>
    </item>
  </channel>
</rss>
