掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
用紙サイズ゛を取得するには? (ID:76155)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
多分(いち様?!)様、さわ様、アドバイスありがとうございました。 返信が大変遅くなってしまい申し訳ありません。 別の案として、グレープシティ社から発売されている「VS-VIEW 7.0J」という ツールを使用してみることにいたしました。 (質問させていただいた後、使用できると連絡がありましたので...。) このツールを使い、自分でプリンタ設定、用紙サイズ、部数、縦横を取得できる 印刷ダイアログを作成しました。 とりあえず、ごりごり作ったので、つたないコードになっておりますが以下に 示しておきます。 とても参考になるアドバイス、本当にありがとうございました。 またお世話になるかもしれませんが、その時はどうかよろしくお願いいたします。 Option Explicit Private Const A3 = "A3、297 x 420 mm" Private Const A4 = "A4、210 x 297 mm" Private Const A4s = "A4 Small、210 x 297 mm" Private Const A5 = "A5、148 x 210 mm" Private Const B4 = "B4、250 x 354 mm" Private Const B5 = "B5、182 x 257 mm" Private Sub Form_Load() Dim i As Integer Dim strPrinter As String '***********************印刷ロジック******************************** 'Windowsに設定されているプリンタドライバの一覧を取得 For i = 0 To VSPrinter1.NDevices - 1 Combo1.AddItem VSPrinter1.Devices(i), i Next '通常使うプリンタ名を取得 Combo1.Text = VSPrinter1.Device Label3.Caption = VSPrinter1.Device strPrinter = Combo1.Text VSPrinter1.Device = strPrinter '用紙サイズを取得 For i = 8 To 13 If VSPrinter1.PaperSizes(i) Then Debug.Print "用紙サイズ"; i; ">使用可能" Select Case i Case "8" Combo2.AddItem A3 Case "9" Combo2.AddItem A4 Case "10" Combo2.AddItem A4s Case "11" Combo2.AddItem A5 Case "12" Combo2.AddItem B4 Case "13" Combo2.AddItem B5 End Select End If Next Combo2.Text = Combo2.List(1) End Sub Private Sub Command1_Click() Dim intPaperOrient As Integer Dim strPaperSize As String Dim strResponse As String VSPrinter1.Text = False strResponse = MsgBox("印刷してよろしいですか?", vbOKCancel) If strResponse = vbOK Then ' [はい] がクリックされた場合、 '使用するプリンタを取得 VSPrinter1.Device = Combo1.Text '用紙サイズ設定 strPaperSize = Combo2.Text Select Case strPaperSize Case A3 VSPrinter1.PaperSize = 8 Case A4 VSPrinter1.PaperSize = 9 Case A4s VSPrinter1.PaperSize = 10 Case A5 VSPrinter1.PaperSize = 11 Case B4 VSPrinter1.PaperSize = 12 Case B5 VSPrinter1.PaperSize = 13 End Select '用紙方向設定 If Option1(0).Value = True Then intPaperOrient = 0 ElseIf Option1(1).Value = True Then intPaperOrient = 1 End If VSPrinter1.Orientation = intPaperOrient '部数設定 VSPrinter1.Copies = imText1.Text VSPrinter1.StartDoc VSPrinter1.Paragraph = Form1.Text3.Text VSPrinter1.EndDoc Else Exit Sub End If End Sub
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2020 Takeshi Okamoto All Rights Reserved.