下面的代码演示在VB里如何获取与Windows操作系统打印机属性里一样多的打印纸张格式 Private Sub Command1_Click() WQL = "Select * From Win32_Printer" Set objinst = GetObject("winmgmts:").ExecQuery(WQL) For Each obj In objinst Debug.Print obj.Name Dim type1 As String For i = 1 To UBound(obj.PaperSizesSupported) Debug.Print obj.PaperSizesSupported(i) Next Next End Sub |