If omitted, the corresponding settings in the Page Setup dialog box will be used. Quality Specifies the DPI output quality you want. Feed is available only in Microsoft Excel for the Macintosh. If omitted, the setting is not changed.įeed is a number specifying the type of paper feed. Color is available only in Microsoft Excel for the Macintosh. If omitted, the note argument in the Page.Setup function is used to determine whether to print notes or not.Ĭolor corresponds to the Print Using Color check box. This argument will override the setting in the Page Setup dialog box. If a chart is active, print_what is ignored. Print_what is a number from 1 to 3 that specifies what parts of the sheet or macro sheet to print. If FALSE, the window will not be displayed If TRUE, the print preview window will be displayed. Preview is a logical value corresponding to the Print Preview button in the Print dialog box. If omitted, the Draft Setting from the Page.Setup function is used. If omitted, the default is 1.ĭraft This argument overrides the draft argument from the PAGE.SETUP function. This argument is ignored unless range_num equals 2.Ĭopies specifies the number of copies to print. This argument is ignored unless range_num equals 2. If range_num is 2, then from and to are required arguments.įrom specifies the first page to print.
Range_num is a number specifying which pages to print.Ģ Prints a specified range. PRINT?(range_num, from, to, copies, draft, preview, print_what, color, feed, quality, y_resolution, selection) PRINT(range_num, from, to, copies, draft, preview, print_what, color, feed, quality, y_resolution, selection) If an argument is TRUE, Microsoft Excel selects the check box if FALSE, Microsoft Excel clears the check box. Arguments corresponding to check boxes are logical values. Prints the active workbook.Īrguments correspond to options, check boxes, and edit boxes in the Print dialog box. ActivePrinter?Įquivalent to choosing the Print command from the File menu. "PRINT(2,1,1,1,2, ""HP LaserJet P1006 on Ne02:"",TRUE,FALSE)"ĭo I replace the red text above with. ActivePrinter = strPrinter & " on " & GetPrinterPort2(strPrinter) ObjReg.GetStringValue HKEY_CURRENT_USER, strRegVal, strPrinterName, strValueĭim strPrinter As String, actPrinter As String, RowNum As Long StrRegVal = "Software\Microsoft\Windows NT\CurrentVersion\PrinterPorts\" Set objReg = GetObject("winmgmts:!\\.\root\default:StdRegProv") Public Function GetPrinterPort2(strPrinterName As String) As Stringĭim objReg As Object, strRegVal As String, strValue As String I'll confess to having very little experience with VBA, so apologies if the following seems hideously wrong, but taking what's suggested in the articles above: I had come across the Pearson article but it did seem slightly complicated for what (I thought) would be fairly straightforward