none
VB.Net2005にてPrintFileへ出力時にPrintDocument.Print()でエラー発生 RRS feed

  • 質問

  • VB.Net2005にてPrintFileに印刷データを出力するプログラムを
    作成しています。


    コードは以下のように組みました。
    Dim pd As New PrintDocument()

    ' PrintFileの作成を指定
    pd.PrinterSettings.PrintToFile = True
    pd.PrinterSettings.PrintFileName = strOutputPath

    ' 用紙サイズを縦向きに設定する。
    pd.DefaultPageSettings.Landscape = False

    pd.PrintController = New System.Drawing.Printing.StandardPrintController
    ' 印刷確認開始
    pd.Print()
    としたとき、
    pd.Print()メソッド実行時に

    ”ハンドルが無効です”とのエラーが発生します。

    何か設定が足りないのかと思いますが、わかりません。
    どなたかご存知の方がいらっしゃいましたら、ご教示いただきたく
    よろしくお願いいたします。

    2007年6月29日 7:38

すべての返信