Page 3 of 5 FirstFirst 12345 LastLast
Results 31 to 45 of 61
  1. #31
    2 Star Lounger
    Join Date
    Jun 2018
    Posts
    107
    Thanks
    43
    Thanked 0 Times in 0 Posts
    Hi Maud

    I was hoping you could look at my code for merging pdfs? I have had to use PDFCreator (as I don't have the full version of Adobe Acrobat and merging won't work with just Adobe Reader).

    The merging works (although I've noticed it can be temperamental) and I have only used 5 files to start with.

    However I don't know how to call the mergePDFs function from within the Print_PDF_Paper1 function with the line (and loop)

    Call apiShellExecute(Application.hwnd, "print", cell.Value, vbNullString, vbNullString, 0)


    I haven't yet done so but am also working on merging the excel template sheet with the pdfs so it all gets merged into one pdf before being printed.

    Any help would be appreciated. Files attached.
    Attached Files Attached Files
    Last edited by ash_2018; 2018-12-12 at 10:53.

  2. #32
    2 Star Lounger
    Join Date
    Jun 2018
    Posts
    107
    Thanks
    43
    Thanked 0 Times in 0 Posts
    Hi

    Not sure anyone can help with this?

    Many thanks in advance

  3. #33
    Gold Lounger Maudibe's Avatar
    Join Date
    Aug 2010
    Location
    Pa, USA
    Posts
    3,122
    Thanks
    170
    Thanked 841 Times in 766 Posts
    Hi Ash,

    Not sure I can help with the direction you are going with merging. If you should decide to copy and rename assigned pdfs with the student's name so they could be grouped, let me know if you need help.

    Maud

  4. The Following User Says Thank You to Maudibe For This Useful Post:

    ash_2018 (2018-12-22)

  5. #34
    2 Star Lounger
    Join Date
    Jun 2018
    Posts
    107
    Thanks
    43
    Thanked 0 Times in 0 Posts
    Hi Maud

    Thanks for replying.

    The idea was... that the files that are being selected when looping through (ie. score <=50%) were merged and sent to print. I can merge 5 'specific' pdf files (see attached file on post 31) but was struggling with merging and printing 5 files that meet a condition.

    On second thoughts (and having the experience of printing the files off the way I have been doing) copying and renaming assigned pdfs may be a better and easier way of doing things. Would the files be stored in separate folders (each folder being the name of each candidate)? I would like to try this out.

    As ever thanks for all your help.

  6. #35
    Gold Lounger Maudibe's Avatar
    Join Date
    Aug 2010
    Location
    Pa, USA
    Posts
    3,122
    Thanks
    170
    Thanked 841 Times in 766 Posts
    Hi Ash,

    You can have all the files in the same folder that will present grouped in a sorted order. Alternatively, you can have subfolders created for each with the student's related PDFs. Let me know the pathway you prefer.

    Maud

  7. The Following User Says Thank You to Maudibe For This Useful Post:

    ash_2018 (2018-12-22)

  8. #36
    2 Star Lounger
    Join Date
    Jun 2018
    Posts
    107
    Thanks
    43
    Thanked 0 Times in 0 Posts
    Hi Maud

    I was thinking subfolders from the angle of organisation. However I have to be mindful of how the files are to be printed and don't want it to take ages .... so all the files, sorted/grouped, in one folder may make printing easier. Could I be cheeky and ask for a button for each option so i can actually see the structure of files in action. If not i'll go with subfolders to be on the safe side.

    Thanks a lot.

  9. #37
    2 Star Lounger
    Join Date
    Jun 2018
    Posts
    107
    Thanks
    43
    Thanked 0 Times in 0 Posts
    Maud

    I've given it some more thought and if you haven't already worked on it I think the subfolders is probably the best option. Appreciate you are busy and the group/sort may be asking for a bit too much help. (Could you let me know if the template is also saved as a pdf in each subfolder as each candidate would have their own along with the 5 pdfs?)

  10. #38
    Gold Lounger Maudibe's Avatar
    Join Date
    Aug 2010
    Location
    Pa, USA
    Posts
    3,122
    Thanks
    170
    Thanked 841 Times in 766 Posts
    Hi ash,

    You have given me an idea. Will work on it over the holidays.

    Maud

  11. The Following User Says Thank You to Maudibe For This Useful Post:

    ash_2018 (2018-12-22)

  12. #39
    2 Star Lounger
    Join Date
    Jun 2018
    Posts
    107
    Thanks
    43
    Thanked 0 Times in 0 Posts
    Thanks Maud.

    Enjoy the break.

  13. #40
    2 Star Lounger
    Join Date
    Jun 2018
    Posts
    107
    Thanks
    43
    Thanked 0 Times in 0 Posts
    Hi Maud

    Just checking if you've had any joy with this?

    Many thanks


    A

  14. #41
    2 Star Lounger
    Join Date
    Jun 2018
    Posts
    107
    Thanks
    43
    Thanked 0 Times in 0 Posts
    Hi Maud

    I would appreciate any pointers or little bit of help with this if you have a minute. I have made some headway with the individual folders but the outcome is not 100% of what I had hoped and I am struggling so it's back to the board.

    Appreciate all your help and I know it's been went a lot (!) but this should be the last of it.

    Thanks again

  15. #42
    Gold Lounger Maudibe's Avatar
    Join Date
    Aug 2010
    Location
    Pa, USA
    Posts
    3,122
    Thanks
    170
    Thanked 841 Times in 766 Posts
    Hi Ash,

    I am such a dog! Haven't had much time to devote to your project but I moved it up on my radar

  16. The Following User Says Thank You to Maudibe For This Useful Post:

    ash_2018 (2019-01-13)

  17. #43
    2 Star Lounger
    Join Date
    Jun 2018
    Posts
    107
    Thanks
    43
    Thanked 0 Times in 0 Posts
    Thanks Maud

    Is there a different way of using

    Call apiShellExecute(Application.hwnd, "print", cell.Value, vbNullString, vbNullString, 0)

    ie. instead of print to "save" the folders? I am trying something but would appreciate a quick pointer here. Nearly at the end now, just want to wrap this up.

  18. #44
    2 Star Lounger
    Join Date
    Jun 2018
    Posts
    107
    Thanks
    43
    Thanked 0 Times in 0 Posts
    Hi Maud

    Not sure where I am on the radar but was hoping you could take a quick look at my code below? I have managed to create individual folders and am looping through trying to copy/paste the relevant pdf files into each associated folder. However the files don't seem to be copying across and I suspect that's because I am using the file path as opposed to the actual physical file? Still new to this and still learning(!)

    (I've attached my files in case you want to see the variable declarations etc.)


    'CREATE INDIVIDUAL FOLDERS
    On Error Resume Next
    For Each cell In rng2
    FldrName = cell
    MkDir "C:\Users\test\Documents\Files" & FldrName
    Next cell


    'COPY PDF FILES IN COLUMN D TO CREATED FOLDERS
    For Each cell In rng1
    If cell.Offset(0, 3) <= 0.5 And count <= 5 Then
    If Not dnary.Exists(cell.Value) Then
    dnary.Add cell.Value, 1
    FileCopy cell.Value, "C:\Users\test\Documents\Files" & FldrName
    'Call apiShellExecute(Application.hwnd, "print", cell.Value, vbNullString, vbNullString, 0)
    count = count + 1
    End If
    End If
    Next cell


    (I know Maud is very busy so if anyone else can help I would really appreciate it.)
    Attached Files Attached Files
    Last edited by ash_2018; 2019-01-12 at 08:09.

  19. #45
    Gold Lounger Maudibe's Avatar
    Join Date
    Aug 2010
    Location
    Pa, USA
    Posts
    3,122
    Thanks
    170
    Thanked 841 Times in 766 Posts
    Hi Ash,

    You give LastRow a value from the active sheet and applied it as the last row for both sheets. This causes problems in the second part of the code.

    But the main issue I see is in this line:

    FileCopy "C:" & cell.Value, "C:\Users\test\Documents\Files" & FldrName

    where "C:" & cell.Value evaluates to C:\C:\TOPICS_01.pdf and FldrName evaluates to "" because the LastRow value is 26. What is FldrName set to in rows 21 - 26 on the Candidate sheet?


    You will need to:
    1. Find the endrow for each sheet and set the ranges accordingly
    2. remove the not needed "C:"
    3. Cycle through the folders using the students names (rng2) from the candidate sheet as the outer loop while the inner loop loos through the topics.

    You're 97% there

    HTH,
    Maud

  20. The Following User Says Thank You to Maudibe For This Useful Post:

    ash_2018 (2019-01-13)

Page 3 of 5 FirstFirst 12345 LastLast

Posting Permissions

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