|
发表于 2005-10-2 10:28:00
|
显示全部楼层
在窗体里加入下列代码
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long
Private m_oApp As Object
Public Property Set Application(ByVal vNewValue As Object)
Set m_oApp = vNewValue
End Property
Private Sub Form_Load()
SetParent Me.hwnd, GetParent(GetParent(m_oApp.ActiveDocument.hwnd))
End Sub
类模块:
Private m_oApp As Object
Public Property Let Application(ByVal vNewValue)
Set m_oApp = vNewValue
End Property
Public Sub ShowForm()
Set frmTest.Application = m_oApp
frmTest.Show
End Sub
|
|