页面内打开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

 

原文地址:https://www.cnblogs.com/lgzh3/p/1348746.html