×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Solidworks macro print to specific printer

Solidworks macro print to specific printer

Solidworks macro print to specific printer

(OP)
Let it be known that I am no good at macros or VB whatsoever.

I am trying to get a macro that allow me to bypass the document level printer settings and print to the printer I setup inside the macro.

I found this thread:
http://www.eng-tips.com/viewthread.cfm?qid=250115&page=1
but I was unable to understand the setup.

I currently use this macro, but regardless of what printer I put in the SWPrinter field, it will print to the printer saved in the document level:
Dim swApp As Object
Dim Part As Object
Dim DrawingDoc As Object
Dim SWPrinter As String
Dim SWOrientation As Long
Dim Fit As Boolean
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Dim FeatureData As Object
Dim Feature As Object
Dim Component As Object
Sub main()

Set swApp = Application.SldWorks

Set Part = swApp.ActiveDoc

SWPrinter = "\\Rytec-1\Engineering"
SWOrientation = swPageSetupOrient_Landscape
Fit = True

Part.Printer = SWPrinter
Part.PageSetup.Orientation = SWOrientation
Part.PageSetup.ScaleToFit = Fit
Part.PrintDirect

End Sub

My goal:
1) Override the document level printer setting and print to the printer saved inside the macro.
2) Print only on A-size paper
3) Always print to fit

Any help is greatly appreciated.
Thanks!
DAVE

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources