强制Excel打印多页纸张作为单个作业 [英] Forcing Excel to print multiple sheets as a single job

查看:233
本文介绍了强制Excel打印多页纸张作为单个作业的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在某些Excel文件(2003年)的工作簿,当我尝试的打印的多个工作表,Excel将表作为单独的打印作业。这fubars excel的自动化软件,我一直在写,因为它会导致Adobe PDF打印机停止并要求用户对第二个文件名。

In some Excel (2003) workbooks, when I attempt to print multiple sheets, Excel treats the sheets as separate print jobs. This fubars the excel automation app I've been writing since it causes Adobe PDF Printer to stop and ask the user for the second file name.

看起来这可能是是与每个页面的指定打印区域,虽然清除(或甚至复位)打印区域不会有所作为。

It looks like it might be something to do with the assigned print area of each page though clearing (or even resetting) the print area does not make a difference.

如何强制Excel打印所有选定的工作表作为一个单独的打印作业?(我使用的是虚拟的Adobe PDF打印机)

How can I force Excel to print all selected sheets as a single print job? (I'm using the virtual Adobe PDF Printer)

除了上述,我怎么可以检测,提前打印,当Excel会将其中一个选择的标签作为一个单独的打印作业或更多?

Barring that, how can I detect, in advance of printing, when Excel will treat one or more of the selected tabs as a separate print job?

我自动化Excel 2003 C3 / .NET3.5和印刷利用的Acrobat 7专业版安装Adobe PDF打印机

I'm automating Excel 2003 with C3/.net3.5 and printing using the Adobe PDF Printer installed by Acrobat 7 Pro.

推荐答案

使用<一个href="http://msdn.microsoft.com/en-us/library/microsoft.office.tools.excel.worksheet.printoutex.aspx"相对=nofollow> PrintOutEx():

foreach (Excel.Worksheet ws in wb.Worksheets)
{
    Excel.PageSetup ps = (Excel.PageSetup)ws.PageSetup;
    ws.PageSetup.Orientation = Excel.XlPageOrientation.xlLandscape;
    ws.PageSetup.Order = Excel.XlOrder.xlDownThenOver;
    ws.PageSetup.FitToPagesWide = 1;
    ws.PageSetup.FitToPagesTall = 50;
    ws.PageSetup.Zoom = false;  
}
wb.Worksheets.PrintOutEx();  

这篇关于强制Excel打印多页纸张作为单个作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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