Check out the RichTextBox control. It can do what you want (concerning colors of your tags). You would have to use SelColor property to assign the desired color.
Usage: ColorTag RichTextBox, TagToColor, ColorCode:Public Sub ColorTag(pRich As RichTextBox, pstrTag As String, pColor As Long) Dim iPos As Integer iPos = 1 iPos = InStr(iPos, pRich.Text, pstrTag) Do While iPos pRich.SelStart = iPos pRich.SelLength = Len(pstrTag) pRich.SelColor = pColor iPos = InStr(iPos + Len(pstrTag), pRich.Text, pstrTag) Loop End Sub
Example: ColorTag RichText1, "<HTML>", vbBlue
You can also use an RGB function gor the color.
For your second question you can do something like this:
Text1.SelText = "MyText"
This will insert the text where the cursor is.
------------------
Serge
Software Developer
[email protected]
ICQ#: 51055819




Reply With Quote