Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools

Let the user insert OLE objects in a RichTextBox control

Total Hit ( 2536)

Rate this article:     Poor     Excellent 

 Submit Your Question/Comment about this article

Rating


 


A little-known feature of the RichTextBox control allows you to insert an OLE object in the text being edited. However, you can do so only programmatically, by adding an element to the OleObjects collection. An easy way to let the user select the object to be embedded in the control is using the InsertObjDlg method of the OLE Container object.

To test this functionality, drop a RichTextBox and an OLE control on a form (leaving their default names), add a cmdInsert button and write this code:

Click here to copy the following block
Private Sub cmdInsert_Click()
  ' Show the InsertObject dialog
  OLE1.InsertObjDlg
  If Len(OLE1.Class) Then
    ' If the user selected an object, show it in the RichTextBox control
    RichTextBox1.OLEObjects.Add , , , OLE1.Class
    OLE1.Class = ""
  End If
End Sub


Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.