Microsoft.Office.Interop.Excel 设置打印两份
时间: 2024-05-18 15:18:00 浏览: 180
要使用Microsoft.Office.Interop.Excel设置打印两份,可以在打印函数中指定打印的份数。在给定的引用中的代码示例中,用到了`workbook.PrintOutEx()`函数来实现打印。该函数有许多参数,其中第三个参数代表打印份数,可以将其设置为2即可打印两份文件。
以下是修改后的代码示例:
```csharp
using Microsoft.Office.Interop.Excel;
Application app = new Application();
Workbook workbook = app.Workbooks.Open(@"C:\Users\kynesyhchen\Desktop\test.xlsx");
Worksheet worksheet = (Worksheet)workbook.Worksheets<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [c# 使用Microsoft.Office.Interop.Excel 对Excel操作](https://blog.csdn.net/weixin_55713843/article/details/126718581)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文