Solved

VB6: Need to print photoshop files in a batch using the default printer.

Posted on 2004-10-12
4
160 Views
Last Modified: 2011-08-18
I need to print a bunch of photoshop files I generated using the photoshop APIs.  All that is done, i just don't know how to do the printing and since it will be large batches it would be a sweet feature to automate.

What code can I use to do such a thing?  Photoshop is the default handler for the .psd files.  I am okay with using the defualt printer if that greatly simplifies things.  Any help?
0
Comment
Question by:Brothernod
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 1

Author Comment

by:Brothernod
ID: 12294853
Is it really different from printing any other file type with the default application?
0
 
LVL 1

Author Comment

by:Brothernod
ID: 12319814
Well I raised the point value in an attempt of getting interest in my topic.  I've seen printing questions answered when i did a search so I don't understand why i'm not getting any attention for my small nuance.
0
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 12354367
Hi, Brothernod.

I don't have access to Photoshop so I've no way to test the code below.  The code sample here uses the ShellExecute API function to print the document name passed.  This approach works fine with Word and various other file types, it invokes the default application based on the file extension, but it apparently doesn't work for all file types.  I don't know about Photoshop files.  You'll need to edit the code and change PathToPSDFile to the fully qualified path and name of a PSD file to test against.

Here are links to more information on the ShellExecute command in case you're interested.
1.  http://www.vb-helper.com/howto_shellexecute.html
2.  http://support.microsoft.com/kb/q170918/
3.  http://www.wincron.com/trflpcshellexecute.html

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
                   (ByVal hwnd As Long, ByVal lpszOp As String, _
                    ByVal lpszFile As String, ByVal lpszParams As String, _
                    ByVal LpszDir As String, ByVal FsShowCmd As Long) _
                    As Long

Private Sub Command1_Click()
    Dim lngResult As Long
    lngResult = ShellExecute(Me.hwnd, "print", "PathToPSDFile", "", "", SW_HIDE)
End Sub
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question