vb 按下command1则打印指定路径的文件?

来源:百度知道 编辑:UC知道 时间:2024/09/22 14:30:04
同上,可以吗?如果可以,能不能增加指定文件的打印数量
word

是什么文件呢?不同的文件打印方法不尽相同。

Private Sub Command1_Click()
Dim WordApp As New Word.Application
WordApp.Visible = False
WordApp.DisplayAlerts = wdAlertsNone
Dim WordDoc As Word.Document
Set WordApp = CreateObject("Word.Application")
Set WordDoc = WordApp.Documents.Open("d:\test.DOC")
WordDoc.PrintOut , , , , , , , 2 '#打印2份
WordDoc.Close
WordApp.Quit
Set WordApp = Nothing
End Sub