共用方式為


Printer.Duplex 屬性

取得或設定值,判斷是否雙面列印 (如果印表機支援此功能)。

命名空間:  Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6
組件:  Microsoft.VisualBasic.PowerPacks.Vs (在 Microsoft.VisualBasic.PowerPacks.Vs.dll 中)

語法

'宣告
Public Property Duplex As Short
public short Duplex { get; set; }
public:
property short Duplex {
    short get ();
    void set (short value);
}
member Duplex : int16 with get, set
function get Duplex () : short 
function set Duplex (value : short)

屬性值

類型:Int16
傳回 Short。

備註

當您使用水平雙面列印時,網頁的兩方上面位於紙張的同一端。 當您使用垂直雙面列印時,下一頁位於紙張的同一端像下頁面頂端。

如果您將這個屬性,在呼叫 PrintCircleLinePSet 方法在新網頁後,會產生執行階段例外狀況。

下表列出 Duplex 的屬性是有效的 PrinterObjectConstants 值。

常數

說明

vbPRDPSimplex

1

使用目前的方向設定為的列印。

vbPRDPHorizontal

2

使用水平翻頁進行雙面列印。

vbPRDPVertical

3

使用一個垂直翻頁進行雙面列印。

注意事項注意事項

Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 命名空間中的函式和物件都是供這些工具使用,以便從 Visual Basic 6.0 升級至 Visual Basic。在大多數情況下,這些函式和物件會複製在 .NET Framework 的其他命名空間中可以找到的功能。只有當 Visual Basic 6.0 程式碼模型與 .NET Framework 實作有顯著差異時,才需要這些項目。

範例

下列範例示範如何設定 Duplex 屬性。

Dim pr As New Printer
Dim ps As New Printing.PrinterSettings
If ps.CanDuplex = True Then
    pr.Duplex = vbPRDPVertical
Else
    MsgBox("Duplex printing is not supported.")
End If

.NET Framework 安全性

請參閱

參考

Printer 類別

Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 命名空間

其他資源

Printer Compatibility Library

How to: Fix Upgrade Errors by Using the Printer Compatibility Library (Visual Basic)

Deploying Applications That Reference the Printer Compatibility Library