Consulting

Results 1 to 5 of 5

Thread: Print PDF file

  1. #1
    VBAX Regular
    Joined
    Sep 2008
    Location
    In a house.
    Posts
    73
    Location

    Print PDF file

    Hello all,

    I have a listbox on a userform that the user can select multiple selections which are PDF forms which the PDF files are located in the same folder as this excel file. I need it to go through the selections in the listbox and print the PDF forms that the user selected. Does anybody know how to do this?

    Something Like this:

    [VBA]Dim lItem As Long
    For lItem = 0 To ListBox1.ListCount - 1
    If ListBox1.Selected(lItem) = True Then
    'PRINT PDF FILE
    End If
    Next[/VBA]

    Thanks all for your help,

    -B

  2. #2
    VBAX Regular
    Joined
    Sep 2008
    Location
    In a house.
    Posts
    73
    Location
    Nobody can help me? Can this not be done?

    Thanks all,

    -B

  3. #3
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    [VBA]select multiple selections which are PDF forms [/VBA]
    I don't understand this. Can you clarify?
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  4. #4
    VBAX Regular
    Joined
    Sep 2008
    Location
    In a house.
    Posts
    73
    Location
    Sorry about being unclear. I Have a listbox that I can select more than one selections and I want to be able to have those selections print the PDF form for which they correspond with. The name in the listbox is the name of the PDF file. So I want the macro to go through each item in the listbox and if it has been selected to print the corresponding PDF file.

    I hope I was able to explain this better.

    Thank you for all your help,

    -B

  5. #5
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    [VBA]Private Sub ListBox1_Click()
    Dim Pth As String
    Pth = "C:\AAA\"
    Shell "c:\program files\adobe\reader 9.0\reader\acrord32.exe /p /h " & Pth & ListBox1
    End Sub
    [/VBA]
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

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