?
Solved

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

Posted on 2004-10-12
4
Medium Priority
?
169 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 1500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses

762 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