Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim oWord As Word.Application
Dim oDoc As Word.Document
oWord = CreateObject("word.Application")
oWord.Visible = True
With oWord
oDoc = .Documents.Add("e:\fred.doc")
.ActiveDocument.PageSetup.PaperSize = Word.WdPaperSize.wdPaperA3
MsgBox(.ActiveDocument.ComputeStatistics(Word.WdStatistic.wdStatisticCharacters))
End With
End Sub
在VB.NET中获得word文档的属性的例子还可参阅:
Q303294 HOWTO: Use VB .NET Automation to Get/Set DocumentProperties
http://support.microsoft.com/support/kb/articles/q303/2/94.asp