确定Excel VBA中打印页面的大小 [英] Determining size of printed page in Excel VBA
本文介绍了确定Excel VBA中打印页面的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Excel VBA中,是否可以确定打印页面的宽度?
In Excel VBA is there a way to determine the width in units of a printed page?
伪代码示例如下:
Dim remainingWidth as Double
remaningWidth = <property that gives printed page width> - _
ActiveSheet.PageSetup.LeftMargin - _
ActiveSheet.PageSetup.RightMargin - _
Range("A:H").Width
推荐答案
此处都是PageSetup的成员..我最初的想法是编写一个接受Orientation和PaperSize并返回页面宽度的函数.例如:
Here are all the members of PageSetup.. My initial thought is to write a function that takes in Orientation and PaperSize and returns the page width. For example:
If ActiveSheet.Orientation = xlLandscape And ActiveSheet.PaperSize = xlPaperLetter Then
dblPaperWidth = 15840 '11 inches in twips
Else
...
End If
这篇关于确定Excel VBA中打印页面的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文