利用下列代码读取word文档,遗漏部分内容,是何原因?Dim dlg As new OpenFileDialog
dlg.Filter = "word|*.doc;*.docx"
If dlg.ShowDialog = DialogResult.OK Then
Dim app As New MSWord.Application
try
Dim doc = app.Documents.Open(dlg.FileName)
Dim count = Doc.Characters.Count
Dim rng As MSWord.Range = Doc.Range(Start:=0, End:=count)
msgbox(rng.Text)
app.quit
catch ex As exception
msgbox(ex.message)
app.quit
End try
End If
测试word文档中的最后一页没有读取: