下面是一段关于打印的代码,但我不知道怎么改了!
例如我要打印C:盘了的一个叫dayin.doc的WORD里的内容.该怎么样去改代码呢!请指教!
Dim x As Printer
Dim int1 As Integer
For Each x In Printers
int1 = int1 + 1
If int1 = List1.ListIndex + 1 Then
Set Printer = x: Exit For
End If
Next
Printer.Print "打印第一页": Printer.NewPage
Printer.Print "打印第二页": Printer.NewPage
Printer.Print "打印第三页": Printer.EndDoc
end sub
例如我要打印C:盘了的一个叫dayin.doc的WORD里的内容.该怎么样去改代码呢!请指教!
Dim x As Printer
Dim int1 As Integer
For Each x In Printers
int1 = int1 + 1
If int1 = List1.ListIndex + 1 Then
Set Printer = x: Exit For
End If
Next
Printer.Print "打印第一页": Printer.NewPage
Printer.Print "打印第二页": Printer.NewPage
Printer.Print "打印第三页": Printer.EndDoc
end sub
解决方案 »
- 为何不能发送滚轮消息?
- 关于VB中嵌套EXCEL表格及如何修改其中数据
- EXCEL打印设置问题!
- 请问哪位有多种颜色的渐变填充?
- 用 vb开发mis系统,操作数据库的代码是放在服务器上的存贮过程好呀?还是放在vb代码中好呀?
- 如何让自己的程序支持插件功能?分数不够另外加。急!!!!!!!!
- ActiveX DLL问题,好奇怪!
- 怎么让一个窗体永远显示在最上面啊?
- 如何从win2000下读取网上邻居列表?
- 小弟把她视为女友啦。由于精力等各方面的原因,小弟实在无精力继续把她完善下去。。。。。。
- 请教:显示PictureBox中某点相对位置的问题
- 求助:我想关闭在程序中弹出的MsgBox,关键是怎么得到这个MsgBox的hWnd
Dim WkWord As New Word.Application
Dim WkDoc As Word.Document
Set WkDoc = WkWord.Application.Documents.Open("c:\my documents\文件.doc")
WkDoc.PrintOut False '在printout后面加上FLASE,會等打完之后再關閉
WkDoc.Close
WkWord.Quit
Set WkDoc = Nothing
End Sub
‘创建word对象
Dim WkWord As New Word.Application
Dim WkDoc As Word.Document
Set WkDoc = WkWord.Application.Documents.Open("c:\my documents\文件.doc")
‘打印
WkDoc.PrintOut False '在printout后面加上FLASE,會等打完之后再關閉
‘关闭
WkDoc.Close
WkWord.Quit
Set WkDoc = Nothing具体代码你可以在word录制宏得到
*****************************************************************************
欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码) 最新版本:20070130http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html
比如说我要打印的是保存在D:盘里的一个stuent的word文档里内容
但我怎么样在窗体里选择stuent呢???
代码怎么写啊??