多谢各位了!
8 个解决方案
#1
手动吧。我以前看过一段代码。没有收集起来。呵呵。
#2
还记得大体思路吗?
是从哪个对象里获得的?
而且,我还需要保存链接信息。
多谢了!
是从哪个对象里获得的?
而且,我还需要保存链接信息。
多谢了!
#3
ding
#4
#5
多谢帮顶^_^
专家们快出来帮俺解答下吧。。。
专家们快出来帮俺解答下吧。。。
#6
“如何在VB打开Word文档”。看看:
http://community.csdn.net/Expert/topic/3549/3549637.xml?temp=.4134333
Dim app As New Word.Application
Dim doc As Word.Document
app.Visible = True
doc = app.Documents.Open("e:\xxx.doc")
Dim para
For Each para In app.ActiveDocument.Paragraphs
if para.style = "标题 1" then
MsgBox app.activedocument.range.text
end if
Next para
http://community.csdn.net/Expert/topic/3549/3549637.xml?temp=.4134333
Dim app As New Word.Application
Dim doc As Word.Document
app.Visible = True
doc = app.Documents.Open("e:\xxx.doc")
Dim para
For Each para In app.ActiveDocument.Paragraphs
if para.style = "标题 1" then
MsgBox app.activedocument.range.text
end if
Next para
#7
用para.outlinelevel而不用para.Style. Outlinelevel 1-9 相当于标题级别1-9. OutlineLevel 10 为正文。
#8
来源:http://topic.csdn.net/t/20060630/11/4852506.html
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 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的几种显示模式,自己一个合适的
#1
手动吧。我以前看过一段代码。没有收集起来。呵呵。
#2
还记得大体思路吗?
是从哪个对象里获得的?
而且,我还需要保存链接信息。
多谢了!
是从哪个对象里获得的?
而且,我还需要保存链接信息。
多谢了!
#3
ding
#4
#5
多谢帮顶^_^
专家们快出来帮俺解答下吧。。。
专家们快出来帮俺解答下吧。。。
#6
“如何在VB打开Word文档”。看看:
http://community.csdn.net/Expert/topic/3549/3549637.xml?temp=.4134333
Dim app As New Word.Application
Dim doc As Word.Document
app.Visible = True
doc = app.Documents.Open("e:\xxx.doc")
Dim para
For Each para In app.ActiveDocument.Paragraphs
if para.style = "标题 1" then
MsgBox app.activedocument.range.text
end if
Next para
http://community.csdn.net/Expert/topic/3549/3549637.xml?temp=.4134333
Dim app As New Word.Application
Dim doc As Word.Document
app.Visible = True
doc = app.Documents.Open("e:\xxx.doc")
Dim para
For Each para In app.ActiveDocument.Paragraphs
if para.style = "标题 1" then
MsgBox app.activedocument.range.text
end if
Next para
#7
用para.outlinelevel而不用para.Style. Outlinelevel 1-9 相当于标题级别1-9. OutlineLevel 10 为正文。
#8
来源:http://topic.csdn.net/t/20060630/11/4852506.html
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 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的几种显示模式,自己一个合适的