如何通过.net打印Excel文件 [英] How to print excel file through .net

查看:110
本文介绍了如何通过.net打印Excel文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建Windows应用程序.我的要求是我选择该文件夹,然后显示此文件夹中的所有excel文件都将打印我的打印机.

解决方案

您可以使用 Directory.GetFiles [^ ]找到excel文件,然后例如使用Interop,打开文件,然后打印所需的数据.例如,请参见: http://msdn.microsoft.com/de-de/library/microsoft.office.interop.excel.range.printout(v=office.11​​).aspx [ ' 用法 Dim 来自 As 对象 昏暗 目标 Dim 复制 As 对象 昏暗预览目标 对象 Dim ActivePrinter As 对象 Dim PrintToFile As 对象 Dim 整理 As 对象 Dim PrToFileName As 对象 Dim returnValue As 对象 range1 As 范围 returnValue = range1.PrintOut(从,,复制,预览,ActivePrinter,PrintToFile,Collat​​e,PrToFileName)


I am create a windows application. My requirement is i select the folder and present all excel file in this folder are print my printer. how are possible.

Yo can use Directory.GetFiles[^] to locate the excel files and then for example using Interop, open the file and then print the desired data. For example see: http://msdn.microsoft.com/de-de/library/microsoft.office.interop.excel.range.printout(v=office.11).aspx[^]


'Usage
Dim From As Object
Dim To As Object
Dim Copies As Object
Dim Preview As Object
Dim ActivePrinter As Object
Dim PrintToFile As Object
Dim Collate As Object
Dim PrToFileName As Object
Dim returnValue As Object
Dim range1 As Range
returnValue = range1.PrintOut(From, To, Copies, Preview, ActivePrinter, PrintToFile, Collate, PrToFileName)


这篇关于如何通过.net打印Excel文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆