页面内打开word 组件。

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long

Private Sub Command1_Click()
Dim wrdObject As Word.Application
Set wrdObject = CreateObject("Word.Application")
wrdObject.Visible = True
Dim hwd As Long
hwd = FindWindow(vbNullString, "microsoft word")
'SetParent hwd, Frame1.hWnd
SetParent hwd, Text1.hWnd

 

你可能感兴趣的:(word)