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 LongPrivate 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
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 LongPrivate 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的几种显示模式,自己一个合适的