Print with Macro Printer Presets

Print with Macro Printer Presets

Anonymous
Not applicable
527 Views
2 Replies
Message 1 of 3

Print with Macro Printer Presets

Anonymous
Not applicable

I wrote a macro about 6 months ago that allowed us to batch print and the macro chose the correct paper size and printed to it. Now we have just made our printers better and the naming convention of the paper sizes changed. The problem is that the paper size names went from 11x17 to 11" x 17". The addition of the spaces and the " is what is causing problems with the macro. If there is anyway I can get the macro to recognize the new names or recognize printer presets then I would be good to go. Here is the line of code I've used to designate paper size in the past.

oPrintMgr.PaperSize = kPaperSize11x17

 

Thank you for any help you can give.

 

Steve

0 Likes
528 Views
2 Replies
Replies (2)
Message 2 of 3

skyngu
Collaborator
Collaborator

i dont think they are related. can you show us more codes?

Autodesk Inventor Professional 2019
0 Likes
Message 3 of 3

Anonymous
Not applicable

Here is the bulk of the printing part of the code. I can get the code to print to all paper sizes that do not have a " mark or a space. I am trying to get IT to fix this but in the mean time I would like a way to deal with the " and the spaces in the paper size names.

 

            Dim oPrintMgr As PrintManager
            Set oPrintMgr = ThisApplication.ActiveDocument.PrintManager
            Dim oDrgPrintMgr As DrawingPrintManager
            Set oDrawDoc = ThisApplication.ActiveDocument
            Set oDrgPrintMgr = oDrawDoc.PrintManager

            oDrgPrintMgr.AllColorsAsBlack = True
            oDrgPrintMgr.ScaleMode = kPrintBestFitScale
            Set oPrintMgr = ThisApplication.ActiveDocument.PrintManager

            ' Printer setup, default printer
            printingprinter = printer
            oPrintMgr.Printer = printingprinter
            oPrintMgr.ColorMode = kPrintDefaultColorMode ' Set to default
            oPrintMgr.NumberOfCopies = 1 ' Set to print one copies.
            oPrintMgr.Orientation = kLandscapeOrientation ' Set to print using landscape orientation.
            oPrintMgr.PaperSize = kPaperSize11x17
            oPrintMgr.SubmitPrint ' Submit the print.

 

0 Likes