Printer.PaperSize 屬性
取得或設定值,這個值表示目前印表機的紙張大小。
命名空間: Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6
組件: Microsoft.VisualBasic.PowerPacks.Vs (在 Microsoft.VisualBasic.PowerPacks.Vs.dll 中)
語法
'宣告
Public Property PaperSize As Short
public short PaperSize { get; set; }
public:
property short PaperSize {
short get ();
void set (short value);
}
member PaperSize : int16 with get, set
function get PaperSize () : short
function set PaperSize (value : short)
屬性值
類型:Int16
傳回 Short。
備註
設定 Printer 物件的 Height 或 Width 屬性自動將 PaperSize 設為 vbPRPSUser。
無法設定這個屬性,在呼叫 Print 方法之後執行階段例外狀況時發生。
下表列出 PaperSize 的屬性是有效的 PrinterObjectConstants 。
常數 |
值 |
說明 |
---|---|---|
vbPRPSLetter |
1 |
字母, 8 1/2 x 11 英吋 |
vbPRPSLetterSmall |
2 |
在小上時, 8 1/2 x 11 英吋 |
vbPRPSTabloid |
3 |
Tabloid, 11 x 17 英吋 |
vbPRPSLedger |
4 |
Ledger, 17 x 11 英吋 |
vbPRPSLegal |
5 |
合法, 8 1/2 x 14 英吋 |
vbPRPSStatement |
6 |
陳述式, 5 1/2 x 8 1/2 英吋 |
vbPRPSExecutive |
7 |
執行器, 7 1/2 x 10 1/2 英吋 |
vbPRPSA3 |
8 |
A3, 297 x 420 公釐 |
vbPRPSA4 |
9 |
A4, 210 x 297 公釐 |
vbPRPSA4Small |
10 |
小 A4, 210 x 297 公釐 |
vbPRPSA5 |
11 |
A5, 148 x 210 公釐 |
vbPRPSB4 |
12 |
B4, 250 x 354 公釐 |
vbPRPSB5 |
13 |
B5, 182 x 257 公釐 |
vbPRPSFolio |
14 |
頁面會 (佔二面), 8 1/2 x 13 英吋 |
vbPRPSQuarto |
15 |
四個開, 215 x 275 公釐 |
vbPRPS10x14 |
16 |
10 x 14 英吋 |
vbPRPS11x17 |
17 |
11 x 17 英吋 |
vbPRPSNote |
18 |
請注意, 8 1/2 x 11 英吋 |
vbPRPSEnv9 |
19 |
#9 信封, 3 7/8 7/8 x 8 英吋 |
vbPRPSEnv10 |
20 |
#10 信封, 4 1/8 1/2 x 9 英吋 |
vbPRPSEnv11 |
21 |
Envelope #11, 4 1/2 x 10 英吋 3/8 |
vbPRPSEnv12 |
22 |
Envelope #12, 4 1/2 x 11 英吋 |
vbPRPSEnv14 |
23 |
Envelope #14, 5 1/2 x 11 英吋 |
vbPRPSCSheet |
24 |
C# 大小工作表 |
vbPRPSDSheet |
25 |
D 大小工作表 |
vbPRPSESheet |
26 |
E 大小工作表 |
vbPRPSEnvDL |
27 |
DL Envelope, 110 x 220 公釐 |
vbPRPSEnvC3 |
29 |
C3 Envelope, 324 x 458 公釐 |
vbPRPSEnvC4 |
30 |
Envelope C4, 229 x 324 公釐 |
vbPRPSEnvC5 |
28 |
C5 Envelope, 162 x 229 公釐 |
vbPRPSEnvC6 |
31 |
C6 Envelope, 114 x 162 公釐 |
vbPRPSEnvC65 |
32 |
C65 Envelope, 114 x 229 公釐 |
vbPRPSEnvB4 |
33 |
Envelope B4, 250 x 353 公釐 |
vbPRPSEnvB5 |
34 |
B5 Envelope, 176 x 250 公釐 |
vbPRPSEnvB6 |
35 |
Envelope B6, 176 x 125 公釐 |
vbPRPSEnvItaly |
36 |
Envelope, 110 x 230 公釐 |
vbPRPSEnvMonarch |
37 |
Envelope 國君, 3 7/8 x 7 1/2 英吋 |
vbPRPSEnvPersonal |
38 |
Envelope, 3 5/8 1/2 x 6 英吋 |
vbPRPSFanfoldUS |
39 |
美式 Standard Fanfold, 14 7/8 x 11 英吋 |
vbPRPSFanfoldStdGerman |
40 |
German Standard Fanfold, 8 1/2 總期數。 |
vbPRPSFanfoldLglGerman |
41 |
German Legal Fanfold, 8 1/2 x 13 英吋 |
vbPRPSUser |
256 |
使用者定義 |
注意事項 |
---|
Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 命名空間中的函式和物件都是供這些工具使用,以便從 Visual Basic 6.0 升級至 Visual Basic。在大多數情況下,這些函式和物件會複製在 .NET Framework 的其他命名空間中可以找到的功能。只有當 Visual Basic 6.0 程式碼模型與 .NET Framework 實作有顯著差異時,才需要這些項目。 |
範例
下列範例示範如何設定 PaperSize 屬性。
Dim Printer As New Printer
Printer.PrintAction = Printing.PrintAction.PrintToPreview
Printer.PaperSize = vbPRPSLegal
Printer.Print("Using legal size paper")
Printer.EndDoc()
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。
請參閱
參考
Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 命名空間
其他資源
How to: Fix Upgrade Errors by Using the Printer Compatibility Library (Visual Basic)
Deploying Applications That Reference the Printer Compatibility Library