CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2010
    Posts
    6

    PDF shell - batch opener

    Hello,

    Im wanting to write a basic VB application that will allow the user to select a bunch of PDF files then print them in bulk. I have achieved something similar with Microsoft Excel, using the shell command to do this. (ie, VB app allowing users to select a bunch of .xls files and batch them to print in Excel using a shell)

    Furthermore, it woul dbe nice to be able to pass in parameters to specify the papersize, orientation
    etc. is that at all possible?

    Is there something similar to the shell command for Adobe Acrobat?

    Thanks,

    Jac

  2. #2
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: PDF shell - batch opener

    The shell command is a VB function that allows you to execute an external program. It has nothing to do with Excel or Adobe.

    If the target program accepts command line parameters to perform the function you desire then you can use shell with the required parameters to make any program do as you wish so long as the program in question provides the interface for the command line parameters/switches needed.
    Always use [code][/code] tags when posting code.

  3. #3
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: PDF shell - batch opener

    You can license the SDK (supposedly) from Adobe.com, but if you talk about it, they KILL you
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  4. #4
    Join Date
    Aug 2010
    Posts
    6

    Re: PDF shell - batch opener

    Hello,

    So i have a way around it, im using the shellexecute, as seen by the following:

    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

    ShellExecute Me.hwnd, "print", "c:\etc.pdf", vbNullString, vbNullString, SW_SHOW

    My next question is, can i specify printing parameters when using this? im particulary interested to specify the paper orientation and paper size?

    Thanks,

    Jac

  5. #5
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: PDF shell - batch opener

    If you set the printer FIRST, the settings should remain for the remaining jobs in the queue
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured