打开文档练习
Imports Microsoft.Office.Interop
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim doc As New Word.Application()
doc.Visible = True
doc.Documents.Open("d:\print.doc")
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim xls As New Excel.Application()
xls.Visible = True
xls.Workbooks.Open("d:\print.xls")
End Sub
End Class