'要 Option Strict Off Using printer As New Management.ManagementObject("Win32_Printer.DeviceID=""Microsoft Print to PDF""") printer.Get() '一応Getしてみても特に変わらず Debug.WriteLine("参考:このプリンターで使用できるプロパティの一覧") For Each prop In printer.Properties Debug.WriteLine($"{prop.Name} = {prop.Value}") Next printer("DefaultPaperType") = "A5" printer.Put() End Using
'要 Option Strict Off Using mc As New Management.ManagementClass("Win32_Printer") Using printers As System.Management.ManagementObjectCollection = mc.GetInstances() Dim printer As Management.ManagementObject = Nothing For Each p In printers If p("Name") = "Microsoft Print to PDF" Then printer = p Exit For End If Next Debug.WriteLine("参考:このプリンターで使用できるプロパティの一覧") For Each prop In printer.Properties Debug.WriteLine($"{prop.Name} = {prop.Value}") Next printer("DefaultPaperType") = "A5" printer.Put() printer.Dispose() End Using End Using