Printer.PrintableRect 屬性 (Publisher)
會傳回 PrintableRect 物件,代表指定印表機列印所在的印表機工作表區域。 唯讀。
語法
運算式。PrintableRect
表達 代表 Printer 物件的 變數。
傳回值
PrintableRect
註解
可列印的矩形區域由印表機根據指定的紙張大小來決定。 印表機紙張的可列印矩形區域不應與出版物頁面邊界內的區域相混淆。 可列印的矩形可能比出版物頁面大,也可能比它小。
注意事項
如果印表機紙張和出版物頁面大小相同,出版物頁面就會置於印表機紙張的正中,且即使選取了印表機的任何標記,它們也不會列印出來。
範例
下列 Microsoft Visual Basic for Applications (VBA) 巨集會示範如何使用 PrintableRect 屬性來取得使用中印表機的印表機工作表可列印矩形的界限。
Public Sub PrintableRect_Example()
Dim pubInstalledPrinters As Publisher.InstalledPrinters
Dim pubApplication As Publisher.Application
Dim pubPrinter As Publisher.Printer
Set pubApplication = ThisDocument.Application
Set pubInstalledPrinters = pubApplication.InstalledPrinters
For Each pubPrinter In pubInstalledPrinters
If pubPrinter.IsActivePrinter Then
With pubPrinter.PrintableRect
Debug.Print "Printable area is " & PointsToInches(.Width) & " by " & PointsToInches(.Height) & " inches."
Debug.Print "Left Boundary: " & PointsToInches(.Left) & " inches (from left)."
Debug.Print "Right Boundary: " & PointsToInches(.Left + .Width) & " inches (from left)."
Debug.Print "Top Boundary: " & PointsToInches(.Top) & " inches(from top)."
Debug.Print "Bottom Boundary: " & PointsToInches(.Top + .Height) & " inches (from top)."
End With
End If
Next
End Sub
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。