I'm trying to convert a field from rtf to txt in dts using vbscript, so I
need something like
Function convertRTFStringToTxt(rtfString)
' Do some magic here to make the conversion using a rich edit control or
Microsoft word automation
rtfString = BrandNewTxtString
end function
Have any recommendations on what I should use? Some COM component, may Rich
Edit or Microsoft Word Automation? Where would I find the interface
descriptions for those. Most of what I've found talks about opening docs,
and as you can see I have the string already and don't need to write it to a
doc, since I'm writing it to a db.
thanks,
Jamie
>Function convertRTFStringToTxt(rtfString)
>' Do some magic here to make the conversion using a rich edit control or
>Microsoft word automation
If you have the control in your HTML page (with an <OBJECT> tag) you can use
the object's ID to get the text like this:
s = TheControlsID.Text()
Hardly magic, but this may not be what you mean.
Of course, if don't have working with user input in a RTF control, but you
do have an RTF string, you can use a control to do the conversion for you:
// This is VBScript, use ActiveXObject() in Javascript
set rtf = CreateObject("RICHTEXT.RichtextCtrl")
rtf.TextRTF = YourRtfString
s = rtf.Text
set rtf = nothing
Hope this helps.
I get an error on the rtf.TextRtf line...Type Mismatch, any ideas?
"Roland Schoofs" <rol...@shire.demon.nl> wrote in message
news:f5el9tkk8ba9tsvqa...@4ax.com...