I have used HTMLArea to good effect in my own applications. It's a helluva
tool.
According to MSDN re: the pasteHTML method:
<quote>
This method might alter the HTML text to make it fit the given text range.
For example, pasting a table cell into a text range that does not contain a
table might cause the method to insert a table element. For predictable
results, paste only well-formed HTML text that fits within the given text
range.
</quote>
Now, given Microsoft's well-meaning but pita propensity to "help" us by
doing a lot of work for us, we might be able to assume from the paragraph
above that when the browser detects a named link it automatically "helps" by
putting the rest of the url in.
So, question: what happens if you leave out the pound sign? Does it go in
the way you want it to then?
Second question: what happens if you break the string with the pound sign
into more pieces, i.e.: str1 = "< href=""", str2="#", str3="Bottom"">", and
so on.
Barring that, what happens if you put in the string thusly: str1 = "<a
href=""" & chr(35) & "Bottom"">"...
--
William Morris
Semster, Seamlyne reProductions
Visit our website,
http://www.seamlyne.com, for the most comfortable
historically inspired clothing you can buy!
"Simon Wigzell" <si**********@shaw.ca> wrote in message
news:KPUgc.180334$Ig.17392@pd7tw2no...
I'm using a 3rd party (htmlarea) WYSIWYG html editting tool. it works
great most of the time. I have a problem where I've made my own function to
create a bookmark type link. e.g. I want to turn the word "Bottom" into a link to
the bottom of the page where resides a bookmark e.g. <a name="Bottom"></a>
The 3rd party software in it's guts has this command:
sRange.pasteHTML(str1 +sHtml+ str2)
Where str1 = <a href="#Bottom">
sHtml = Bottom
str2 = </a>
sRange is the highltighted text that I want to make a link.
So you would expect it to make a string like this:
<a href="#Bottom">Bottom</a>
However, it makes a string like this :
<A
href="http://www.virtualcottageindustries.com/webpageRecordEditor.asp#Bottom ">Bottom</A>
Where http://www.virtualcottageindustries....cordEditor.asp is
the page that contains the 3rd party WYSIWYG editor. The HTML text I'm
creating here gets saved to a database and then used to generate a web page of a
completely different name. All I want is this : <a
href="#Bottom">Bottom</a>
Any ideas?