Dim app As New MSWord.Application try Dim fileName = "D:\test.doc" Dim doc = app.Documents.Open(fileName) Dim t = Doc.Tables(1) t.Select Dim n = app.ActiveWindow.Selection.Information(msword.WdInformation.wdActiveEndPageNumber) msgbox(n) catch ex As exception msgbox(ex.message) finally app.Quit End try
|