Option Explicit
Private Sub Form_Click() RichTextBox1.SelStart = 3 RichTextBox1.SelText = "[new hi there]" End Sub '_________________________________________________________ Private Sub Form_DblClick() Dim lpobj As OLEObject Dim szfilename As String szfilename = App.Path & "\ttt444.bmp" ' put some valid file name here Set lpobj = RichTextBox1.OLEObjects.Add(, , szfilename) lpobj.DisplayType = rtfDisplayContent ' if you un comment the following line you will go to edit mode: 'lpobj.DoVerb End Sub '_________________________________________________________ Private Sub Form_Load() Me.RichTextBox1.Text = "Hi there" End Sub |