第1个回答 2016-12-27
If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
Dim docApp As Word.Application
Dim docDocument As Word.Document
Try
docApp = New Word.Application
docDocument = docApp.Documents.Open(OpenFileDialog1.FileName, , , , , , , , , , , , , , , )
Dim strTemp As String
For i = 1 To docDocument.Paragraphs.Count
'''''这里是一段一段的读出,你也可以选择别的方式
strTemp = docDocument.Paragraphs(i).Range.Text.Trim
Debug.Print(strTemp)
Next
Catch ex As Exception
Throw ex
End Try
End If
工程里面引用Microsoft Word 14.0 Object Library
另外,网上vb.net的资料真心少,查资料的时候可以查c#的,改改语法就是了,都是.net家族的,通用