ShowProperties
Sub ShowProperties( _ ByVal Ctrl As Object, _ Optional ByVal CtrlName As String, _ Optional ByVal hWndParent As Long) Dim oSPP As ISpecifyPropertyPages Dim tPages As CAUUID On Error Resume Next ' Get ISpecifyPropertyPages interface ' of the control Set oSPP = Ctrl If oSPP Is Nothing Then ' If the QI fails try using the ' Object property of the control Set oSPP = Ctrl.Object If oSPP Is Nothing Then ' Reset the error handler On Error GoTo 0 ' Raise an error Err.Raise 13 End If End If ' Get the CLSIDs of the pages oSPP.GetPages tPages ' Show the pages OleCreatePropertyFrame hWndParent, 0, 0, _ CtrlName, 1, Ctrl, tPages.cElems, _ ByVal tPages.pElems, 0, 0, 0 ' Release the pages array CoTaskMemFree tPages.pElems End