3 个解决方案
#1
打开Word后,用Findwindow查找它的句柄,然后用MoveWindow控制word窗口的大小和位置
可以创建word对象来打开文档结构图
可以创建word对象来打开文档结构图
#2
不明白。
#3
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
Private Sub Command1_Click()
Dim wdApp As Object
Dim wdBook As Object
Set wdApp = CreateObject("Word.Application")
Set wdBook = wdApp.Documents.Open("c:\test.doc")
wdApp.Visible = True
If ActiveWindow.View.SplitSpecial = wdPaneNone Then
ActiveWindow.ActivePane.View.Type = wdMasterView
'ActiveWindow.ActivePane.View.Type =wdNormalView
'ActiveWindow.ActivePane.View.Type =wdOutlineView
'ActiveWindow.ActivePane.View.Type =wdPrintPreview
'ActiveWindow.ActivePane.View.Type =wdPrintView
'ActiveWindow.ActivePane.View.Type = wdWebView
Else
ActiveWindow.View.Type = wdMasterView
'ActiveWindow.View.Type = wdNormalView
'ActiveWindow.View.Type = wdOutlineView
'ActiveWindow.View.Type = wdPrintPreview
'ActiveWindow.View.Type = wdPrintView
'ActiveWindow.View.Type = wdWebView
End If
Application.ActiveWindow.DocumentMap = True '显示文档结构
Dim wHwnd As Long
wHwnd = FindWindow("OpusApp", "Word窗体的标题")
MoveWindow wHwnd, 100, 100, 400, 300, True
End Sub
-----------------
wdMasterView
wdNormalView
wdOutlineView
wdPrintPreview
wdPrintView
wdWebView
这是些Word的几种显示模式,自己一个合适的
Private Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
Private Sub Command1_Click()
Dim wdApp As Object
Dim wdBook As Object
Set wdApp = CreateObject("Word.Application")
Set wdBook = wdApp.Documents.Open("c:\test.doc")
wdApp.Visible = True
If ActiveWindow.View.SplitSpecial = wdPaneNone Then
ActiveWindow.ActivePane.View.Type = wdMasterView
'ActiveWindow.ActivePane.View.Type =wdNormalView
'ActiveWindow.ActivePane.View.Type =wdOutlineView
'ActiveWindow.ActivePane.View.Type =wdPrintPreview
'ActiveWindow.ActivePane.View.Type =wdPrintView
'ActiveWindow.ActivePane.View.Type = wdWebView
Else
ActiveWindow.View.Type = wdMasterView
'ActiveWindow.View.Type = wdNormalView
'ActiveWindow.View.Type = wdOutlineView
'ActiveWindow.View.Type = wdPrintPreview
'ActiveWindow.View.Type = wdPrintView
'ActiveWindow.View.Type = wdWebView
End If
Application.ActiveWindow.DocumentMap = True '显示文档结构
Dim wHwnd As Long
wHwnd = FindWindow("OpusApp", "Word窗体的标题")
MoveWindow wHwnd, 100, 100, 400, 300, True
End Sub
-----------------
wdMasterView
wdNormalView
wdOutlineView
wdPrintPreview
wdPrintView
wdWebView
这是些Word的几种显示模式,自己一个合适的
#1
打开Word后,用Findwindow查找它的句柄,然后用MoveWindow控制word窗口的大小和位置
可以创建word对象来打开文档结构图
可以创建word对象来打开文档结构图
#2
不明白。
#3
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
Private Sub Command1_Click()
Dim wdApp As Object
Dim wdBook As Object
Set wdApp = CreateObject("Word.Application")
Set wdBook = wdApp.Documents.Open("c:\test.doc")
wdApp.Visible = True
If ActiveWindow.View.SplitSpecial = wdPaneNone Then
ActiveWindow.ActivePane.View.Type = wdMasterView
'ActiveWindow.ActivePane.View.Type =wdNormalView
'ActiveWindow.ActivePane.View.Type =wdOutlineView
'ActiveWindow.ActivePane.View.Type =wdPrintPreview
'ActiveWindow.ActivePane.View.Type =wdPrintView
'ActiveWindow.ActivePane.View.Type = wdWebView
Else
ActiveWindow.View.Type = wdMasterView
'ActiveWindow.View.Type = wdNormalView
'ActiveWindow.View.Type = wdOutlineView
'ActiveWindow.View.Type = wdPrintPreview
'ActiveWindow.View.Type = wdPrintView
'ActiveWindow.View.Type = wdWebView
End If
Application.ActiveWindow.DocumentMap = True '显示文档结构
Dim wHwnd As Long
wHwnd = FindWindow("OpusApp", "Word窗体的标题")
MoveWindow wHwnd, 100, 100, 400, 300, True
End Sub
-----------------
wdMasterView
wdNormalView
wdOutlineView
wdPrintPreview
wdPrintView
wdWebView
这是些Word的几种显示模式,自己一个合适的
Private Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
Private Sub Command1_Click()
Dim wdApp As Object
Dim wdBook As Object
Set wdApp = CreateObject("Word.Application")
Set wdBook = wdApp.Documents.Open("c:\test.doc")
wdApp.Visible = True
If ActiveWindow.View.SplitSpecial = wdPaneNone Then
ActiveWindow.ActivePane.View.Type = wdMasterView
'ActiveWindow.ActivePane.View.Type =wdNormalView
'ActiveWindow.ActivePane.View.Type =wdOutlineView
'ActiveWindow.ActivePane.View.Type =wdPrintPreview
'ActiveWindow.ActivePane.View.Type =wdPrintView
'ActiveWindow.ActivePane.View.Type = wdWebView
Else
ActiveWindow.View.Type = wdMasterView
'ActiveWindow.View.Type = wdNormalView
'ActiveWindow.View.Type = wdOutlineView
'ActiveWindow.View.Type = wdPrintPreview
'ActiveWindow.View.Type = wdPrintView
'ActiveWindow.View.Type = wdWebView
End If
Application.ActiveWindow.DocumentMap = True '显示文档结构
Dim wHwnd As Long
wHwnd = FindWindow("OpusApp", "Word窗体的标题")
MoveWindow wHwnd, 100, 100, 400, 300, True
End Sub
-----------------
wdMasterView
wdNormalView
wdOutlineView
wdPrintPreview
wdPrintView
wdWebView
这是些Word的几种显示模式,自己一个合适的