WshNetworkオブジェクトからプリンタ情報を取得 | Lotus Notes Tips! Last modified : 2004/04/07 |
Sub Click(Source As Button) ' --- Windows Scripting Hostオブジェクト作成 Dim wshObject As Variant Set wshObject = CreateObject("WScript.Network") ' --- プリンター情報を取得し表示 msgTitle = "Printer Information" Set printer = wshObject.EnumPrinterConnections() Dim i As Integer i = 0 Do While i < printer.length ' ループ実行前に i の値を検証 Msgbox printer.Item(i+1) & " on " & printer.Item(i), vbInformation, msgTitle i = i + 2 Loop End Sub |