【发布时间】:2013-05-07 07:29:47
【问题描述】:
我正在尝试获取活动打印机的物理边距。但我不确定我应该为 GetDeviceCaps 函数的第二个参数提供什么值。谁能告诉我 HORZSIZE 和 VERTSIZE 的值是什么我可以设置以获得实际的打印机值。
如果我使用 0 作为第二个参数的值,我得到的 getX 和 getY 值为 1024。有人可以帮帮我吗。
注意: DefaultPrinterInfo 是用户定义的函数,用于获取驱动程序名称和打印机名称
Sub GetDevCaps()
Dim str() As String
Dim hdc As Long, delHdc As Long
Dim getX As Long, getY As Long
str = DefaultPrinterInfo
hdc = CreateDC(str(1), str(0), 0, 0)
getX = GetDeviceCaps(hdc, ?)
getY = GetDeviceCaps(hdc, ?)
delHdc = DeleteDC(hdc)<br>
End Sub
【问题讨论】:
标签: vba excel excel-2007 excel-2010