Walk Lightly on this PLANET and yet leave such a FOOTPRINT that cannot be erased for thousands of Years..!!!
Visit Codstech for Cyber Security related Posts !

Visitors

Wednesday, May 25, 2011

VB-7 : Part of an OLE Object

Refer VB-6 : Creating OLE at Design time also.This code links or embeds the complete file.
In case, a part of the file is to be used as an object, the steps involved are as follows:



Here we need two command buttons ,and one OLE ( Once the OLE box has appeared,click CANCEL to remove this dialog box)

A)   Property :
Command button : NAME- Command1 , CAPTION- Use OLE
Command button : NAME- Command2 , CAPTION- Exit
OLE                     : NAME-OLE1



B)   Attaching Code to the Object :
Private Sub Command1_Click()
If OLE1.PasteOK = True Then
OLE1.PasteSpecialDlg
End If
If OLE1.OLEType = 3 Then
MsgBox "Nothing has been copied"
End If
End Sub

Private Sub Command2_Click()
End
End Sub

Back to Home   &  VB

No comments: