使用vb.net 2005在Excel工作表中设置打印区域 [英] Set Print Area in excel sheet using vb.net 2005
问题描述
大家好!我正在使用vb.net 2005在excel 2007上添加ins。我想在工作表中设置两个不同的打印区域。我想在单页打印这些区域。我是怎么做到的
我成功使用以下代码设置了两个不同的打印区域。
myWorkSheet.PageSetup.PrintArea =" $ A $ 1 B $ 10,$ D $ 1 E $ 10 "
myWorkSheet.PrintPreview()
它设置了两个不同的打印区域,但是当它显示打印预览时,它显示两个不同的页面。但我想打印这些是单页。
请帮助
Thanx
Mitesh Khatri
Hi to all
I am working on excel 2007 add ins using vb.net 2005. and i want to set the two different print area in my work sheet. and i want to print these area in single page. how i do this.
I am success in set the two different print area using following code.
myWorkSheet.PageSetup.PrintArea = "$A$1B$10,$D$1E$10"
myWorkSheet.PrintPreview()
It set the two different print area but when it shows print preview it shows two different pages.but i want to print these are in single page.
Please Help
Thanx
Mitesh Khatri
推荐答案
Hi Mitesh,
Hi Mitesh,
根据我的理解,我们无法通过设置PrintArea属性在同一页面中打印两个不连续范围。你看到的是Excel的设计行为。如果要在同一页面上打印A1-B10和D1-E10,可以尝试将它们复制到连续范围,如F1-I10并打印该区域。
As my understanding, we cannot print two discontinuous range in the same page via setting PrintArea property. What you see is the by design behavior of Excel. If you want to print A1-B10 and D1-E10 on the same page, you can try to copy them to a continuous range, like F1-I10 and print that area.
谢谢,
Ji
这篇关于使用vb.net 2005在Excel工作表中设置打印区域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!