I have a question i have this code and i and wondering if this can be inserted into the messenger above. There is a problem thought evertime it send the smile it will popup with your picture editor to show the picture. Can this be added to the code above to send smileys?
Private Sub Command1_Click()
'First, just add plain text:
rchText1.SelText = rchText1.SelText & "Guest: " & Text1 & vbCrLf
'Then change what needs to be changed to pictures:
rchText1.SelStart = Len(rchText1.Text) 'Put the start at the end, thats where you want to add the next line
Text1 = ""
Private Sub Form_Load()
rchText1.OLEObjects.Clear 'Clear the ole objects to prevent errors
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
rchText1.OLEObjects.Clear 'You must add this or the
'program will crash. This doesnt
'happen in Windows 2k
Sub RefreshPics() 'This scans the text for :) and (l)'s to change
Dim lFoundPos As Long 'Position of first character
Dim lFindLength As Long 'Length of string to find
Dim MakeSure As Boolean 'I have this to do the procedure twice, just to "make sure"
MakeSure = True
lFoundPos = rchText1.Find(":)", 0, , rtfNoHighlight)
While lFoundPos > 0
rchText1.SelStart = lFoundPos
'The SelLength property is set to 0 as
'soon as you change SelStart
rchText1.SelLength = 2
rchText1.SelText = ""
rchText1.OLEObjects.Add , , App.Path & "\smile.bmp" 'Add the picture after it has deleted the string
'Attempt to find the next match
lFoundPos = rchText1.Find(sFindString, lFoundPos + 2, , rtfNoHighlight)
If MakeSure = False Then GoTo Start
' I guess by changing or adding a few lines, you
' can make it add more pictures with different strings.
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Command1_Click