I created a program in Excel VBA that uses the Adobe Acrobat 10.0 Type Library to read a source PDF using Acro_JSO.getpagenthword(Pg_Cntr, Wrd_cntr) and if a certain word if found, extract the page either an new or existing PDF using the InsertPages function.

Please Login or Register  to view this content.
This had been working correctly for some time with PDFs from the user, but now it will run through the source parse correctly and even create the destination PDFs, but they extract at only 4 KB and when you go to open them, the message says 'There was an error opening the document This file cannot be opened because it has no pages.'

I am assuming it is something with the source file because old source files work correctly. I made sure that in the source PDF, the 'Enable Protected Mode at Startup ("Preview") was unchecked under Preferences ->Security(Enhanced)'. That had caused issues in the past. I also unchecked Enable Enhanced Security as well.

I am trying to compare between a source PDF that worked and one that didn't and the Preferences all look the same.

Is there a way in the VBA code to confirm that the InsertPages function actually copied data?