Gotta problem.
We are remodeling our office and people are moving but the printersaren't. The problem is Sw doesn't print to the default printer, itprints to whatever the drawing has for printer settings.
So, we have users across the buliding that are printing SWdocuments and then realize that the printer isn't next to themanymore.
So i was wondering if anyone has a macro that would print to thewindows default printer?SolidworksApi macros
We are remodeling our office and people are moving but the printersaren't. The problem is Sw doesn't print to the default printer, itprints to whatever the drawing has for printer settings.
So, we have users across the buliding that are printing SWdocuments and then realize that the printer isn't next to themanymore.
So i was wondering if anyone has a macro that would print to thewindows default printer?SolidworksApi macros

I believe what you are after is:
ModelDoc2:: PrintDirect
Description:
This method prints the current document to the default printer.
The macro you are after would be something in the lines:
Option Explicit
Dim swApp As SldWorks.SldWorks
Dim modelDoc As SldWorks.ModelDoc2
Sub main()
Set swApp = Application.SldWorks
Set modelDoc = swApp.activedoc
modelDoc.printDirect
end sub
Hope it helps
--Stav.
P.S you can also use modeDoc2:: Printer to get or set the defaultprinter.
Thanks, Ben
Yes there is.
Have a look at
ModelDoc2::Printer.
Description
This property gets or sets the default printer for this document.
Once you set your default printer:
Remarks
ModelDoc2::PrintDirect and ModelDocExtension::PrintOut2 use thissetting if you pass an empty string to printer.
Cheers,
--Stav.
I've worked out how to use the PrintOut2 command, but was trying tosee if there is a way to see what the printer names are that areavailable to print to. I basically want the person running themacro to be able to select which printer their drawings will getprinted to, from a list of available printers on their computer.
Is there any way to do this?
Thanks, Ben
In VB6 there is a printer object (http://msdn2.microsoft.com/en-us/library/aa267233.aspx),it's not clear to me it's availabe in SolidWorks VBA though. I'veused this one in VB6 and it's quite a bit more straight forwardthan the one above.
As a strange side note, setting the printer in SolidWorks is casesensitve (which you will have the right case using the enumeratemethod). For some reason when different people at my company map tonetwork printers the case can vary.
MB
Yeah the main reason I'm needing to look into getting the list ofprinters is we have varying case for our printer names too.
Dim myPrinter As String
cbPrinter.Items.Clear()
For Each myPrinter InSystem.Drawing.Printing.PrinterSettings.InstalledPrinters
cbPrinter.Items.Add(myPrinter)
Next
--John