VBA Merge PDFs - Error when first and second PDF are the same

Using http://khkonsulting.com/2009/03/adobe-acrobat-and-vba-an-introduction/ as a guide, I am able to successfully merge multiple pdf's together into one document using VBA (Access mdb), except when the PDF being merged to has the same name as the next PDF.
Here's my scenario.  An Access table is updated with a list of reports that need to be printed.  All of these reports are PDF's.  I loop thru this table and merge the PDF's according to an identifier, then print the group.  There are times
when there are multiple copies of the same report for an identifier.  If the PDF being merged to has the same name of the PDF being merged, an error occurs.  How can I handle this situation?
Sample data:  This identifier (ESO and Pulling) needs to merge these PDF's (Aaa.PDF) together which happen to have the same name.  Aaa.PDF is trying to merge Aaa.PDF and this throws an error.
Aaa.PDF ESO  Pulling
Aaa.PDF ESO  Pulling
This identifier merges fine despite having the same PDF twice.  But the first PDF is not named the same.  Xxx.PDF is the first PDF and merges the next two into it.  The last two
are named the same.
Xxx.PDF  916  Pulling
Bbb.PDF  916  Pulling
Bbb.PDF  916  Pulling
Code:
pdfDoc1.Open (filesToMerge(1))
numPages = pdfDoc1.GetNumPages()
Set pdfDoc2 = CreateObject("AcroExch.PDDoc")
Dim i As Integer
For i = 2 To intNbr - 1
pdfDoc2.Open (filesToMerge(i))
If pdfDoc1.InsertPages(numPages - 1, pdfDoc2, 0, pdfDoc2.GetNumPages(), True) = False Then
MsgBox "Cannot insert pages"
End If
pdfDoc2.Close
Next i
If pdfDoc1.Save(PDSaveFull, "C:\....\ReportPacket__" & Trim(CStr(intReportCount)) & "__" & ... & ".pdf") = False Then
MsgBox "Cannot save the modified document"
End If
pdfDoc1.Close
The pdfDoc1.InsertPages command fails, displays "Cannot insert pages", then displays "Method 'Close' of object 'CAccroPDDoc' failed.
Thanks for any help or advice.

Hi
As far as I know, Access didn't provide such method. But I think you are able to achieve this goal through some 3rd party PDF component
Hope this will help you.
Best Regards
Lan
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Best practice when FACT and DIMENSION table are the same

    Hi,
    In my physical model I have some tables that are both fact and dimension table, i.e. in the BMM they are of course separated into Fact and Dim source (2 different units) and it works fine. But I can see that there will be trouble when having more fact tables and I e.g. have a Period dimension pointing to all the different fact tables (different sources).
    Seems like the best solution to this is to have an alias of the fact/transaction table and have 2 "copies" of the transaction table (one for fact and one for dimension table) in the physical layer. Only bad thing is that there will then allways be 2 lookups in the same table when fetching data from the dimension and the fact table.
    This is not built on a datawarehouse - so the architecture is thereby more complex. Hope this was understandable (trying to make a short story of it).
    Any best practice on this? Or other suggestions.

    Id recommend creation of a view in the database. if its an oracle DB, materialised views would be a huge performance benefit. you just need to make sure that the MVs are updated when the source is updated.
    -Domnic

  • CDS-18010 Error:A Index and a index with the same name

    Hi
    I am facing strange error is some one expert there to help me to get rid of this error.
    CDS-18010 Error:A Index and a index with the same name 'LA_SP_FK_1' have been asked to be created.
    I am generating tables from Data model diagram & getting this error.
    Thanks,
    Vijay

    Your Right!!
    Designer does not like 2 of the same name.
    there are several bugs on the same name issue and CDS-18010
    Bug.3973155/3443005 (92) CDS-18010 IN CAPTURING A TYPE WITH CONSTRUCTOR FUNTIONS IN ITS BODY:
    Bug.2586582 (93) CDS-18010 A DOMAIN AND A DOMAIN WITH THE SAME NAME 'D1' BEEN ASKED TO CREATE:
    Bug.2561625 (15) CDS-18010 GENERATION OF TWO SYNONYMS WITH SAME NAME BUT DIFFERENT SCOPE:
    Bug.2072505 (93) CDS-18010 CAPTURING 2 TRIGGERS WITH SAME NAME ON ONE TABLE SHOULD BE A WARNING:
    Bug.1689800 (90) CDS-18010 PLSQL WITH THE SAME PROCEDURE NAME ALREADY EXISTS:
    Bug.1073311/1029997 (96) CDS-18010 ERROR ATTEMPTING TO CREATE 2 PROCEDURES WITH SAME NAME:
    Just to name a few.
    I would suggest you change the name.
    Michael

  • My battery runs low very fast (three hours). I looked in the usage settings and it seems the time for usage and stand-by are the same, allthough i did have my iphone on stand-by!! What can i do?

    Community,
    I have a problem with my iphone 4. Every few months my battery starts draining within a few hours. I have tried all kinds of battery saving tips, but they don't help. When i go to the settings/general/usage is can see that the time for Usage and Stand-by are the same, so my phone is fully on all the time this explains the draining. But in reallity i turn my phone to stand-by most of the time, i mean the screen is black and all???
    The first and second time a had this problem, both a few months a part,  i restored my phone and it was solved. This time i restored my phone but this did not help!! And restoring my phone every two months is not my preferd way of solving this problem.
    Does anybody have an idea on how to solve this problem? can anybody help me?
    best regards,
    Merijn

    Restoring is the answer. It sounds as if there is a rogue process constantly draining your battery.
    The issue you face is that, if you restore your backup thereafter, you risk the problem coming straight back with your files.
    Store your files individually and it is time to start fresh.

  • Could nt complete your request because source and destination files are the same

    Hi, thank you for reading.
    I'm having this problem and it's driving me nuts.
    I'm actually following a tutorial that you can check out here: http://nightshifted.tumblr.com/post/2559360661/tutorial-paused-animations
    basically I'm trying to do a animated gif with canvas (I'm sorry if my english is not so great). when I try to drag the layers into the canvas (step 2 of the tutorial), I get the error: "could not complete your request because source and destination are the same".
    can anybody help me? I have both CS3 and CS5 and they the error appears in both.
    thank you in advanced

    I think they mean select the layers and frames and using the move tool, drag
    inside the document (click inside the document window and drag) to move the
    selected layers to the top half  (transparent area), not to drag the layers from
    the layers palette into the document, which would give that error.
    MTSTUNER

  • *Fix* Usage and Standby Times are the same - iPhone 4S 7.0.4

    I'd like to share my experience here because I actually found the solution on here but I'm actually having trouble finding it again.
    I had three problems:
    1. My standby and usage times were always reporting the same values, thus draining my battery faster than usual. This is not normal behavior; whenever the screen is off it should report standby times, and after the phone is unlocked it is considered usage. They should never be recording in tangent.
    2. Whenever I would try to turn off my phone by holding down the power button, the phone would basically restart itself, showing the Apple logo boot screen and then restarting. The only caveat was that it would turn off if it was plugged in and being charged. But take it off the charger and try to replicate it turning off and it would restart.
    3. The sound would sometimes think that it was connected to a Dock, so when I went to the Airplay options, they were listed as Dock Connector, Airport Express and Apple TV. There would be no volume slider in the Control Center, and when pressing the volume buttons, there would be no dots, just the bell with a line through it.
    Many people might be having genuine battery issues, where you have an older phone and your battery is just really bad and needs to be replaced. My 4S was still under AppleCare in December 2013 and the battery was pretty bad, so I had it replaced in an Apple Store. So for me, the battery life itself was not the problem.
    I tried a lot of things to try and fix the above problem but none of them helped. This includes chatting with Apple support (I was surprised they didn't steer me in an obvious direction, considering the large amount of folks who were having these kinds of problems, but they played dumb), restoring fresh and restoring icloud and itunes backups, all kinds of combinations of settings for Mail, iCloud, etc., but nothing worked. I probably restored my phone at least ten times in my troubleshooting efforts. The isolated test of restoring my phone fresh, setting it up to the start screen, making sure the battery was charged 100% and taking it off the charger waiting about 10 minutes. Then I would check standby and usage times.
    I had read about fixes for the phone not being able to turn completely off, and it had something to do with cleaning the charging port. I attempted to clean the port with compressed air and other methods, but it never fixed this problem. Then I read a post on Apple Support about a guy who had the exact same problems as I did, then said he changed out his charging port and this fixed it. Well, it was $40 so I paid someone to do it in 45 minutes.
    After I got my phone back the problem didn't appeared to be fixed, but after a restore and even with an icloud backup restored with it, I looked down at my phone and presto chango, the times where separate and working as they should. Last night with wifi off while I was sleeping, the battery only went down 3%. I know this is turning out to be a narrative, but I spent a lot of time trying to figure out what the problem was and it was a frustrating process. I'm happy it's resolved.
    Apple Support thought it was a corrupt install package from iTunes, or some kind of software glitch or maybe some part of iCloud constantly trying to call home, but it was a combination of both hardware and software. Because of the bad charging port, for some reason the phone thought it was still being used and thus was still treating standby as usage.
    I would encourage those that are having this problem to do a test and see if your phone will turn off when you want it to. If it resets automatically and if your standby usage times are the same, replacing the charging port might fix it.

    Ever since iOS7.0.6. and still on iOS7.1 both me and my wife had huge battery drain on our iPhone 4S and stand-by was equal to usage time. We finally found the solution to a post of another user on the Dutch Tweakers forum. There seem to be a bug within a certain Dutch coupon app called 'Scoupy' which drained the battery completely although GPS setting was turned of and also 'refresh on background' was off.
    Scoupy said that a fix for their app is send for approval to the App Store. We removed the app and our usage/stand-by time is again as normal (higher stand-by time then usage time) and best of all a 'normal' battery use as it was the case on iOS7.0.4. I hope this could help someone. I'm wondering if the iBeacon changes in iOS7.0.6/7.1 together with a bug in the Scoupy app could be the cause? Maybe this is also with our similar apps you have on your phone.

  • Unrendered Audio - sequence and clip settings are the same

    When I drag a clip to the timeline a redline appears on the top of the timeline. I know this means that there is a setting issue between the sequence and the clips. All the settings are the same with the exception of the:
    audio format - Clip: 8 bit integer
    Seq: 32 Bit Floating
    Audio Rate - Clip: 48000 5kh
    Seq: 48.0 KH
    The clips which is 1 1/2 HR takes 6 minutes to render.
    Does anyone know why I need to render this clip?
    Macbook Pro   Mac OS X (10.4.8)  

    Here: a foolproof way to ensure clip-sequence settings match up:
    http://web.mac.com/steelepro/iWeb/steelecuts.com/fcs%20detective/6FD1D5FD-0C56-4 F06-992C-902D00556549.html
    And if you still have the problem, why not convert it to AIFF via QT?

  • Cannot set up iPad since my email and apple id are the same.  Help?

    I cannot set up my new iPad since the apple ID and the email are the same, any suggestions?

    Anything here to help? http://support.apple.com/kb/HE37

  • Is Snapshot and Materialised view are the same?

    Can you please help me on this...
    I am using oracle 10G enterprise edition...
    Thanks in advance..

    Re: Is Snapshot and Materialised view are the sameYes

  • IPhoto had an error when updating and now says: "Use the Purchases page to try again."

         Before I went to school yesterday morning I started the iPhoto update so when I got back it would be done. So I looked to see if the update was finshed and it said: "An error haas occured" next to the update button. So I hit update again and it came up with what you see in the picture below.
    So I went to the purchase tab and tried again and the same thing happened again! What do I do? Thank you!

    Hi there!
    Did you get any explanation for that "8.8.8.8-solution"? Very strange but it seemed to work with me but only for some apps.
    My problem doesn't look the same though. I managed to download all big apps like iPhoto and Xcode but the small ones never get installed properly. I see they are being downloaded but after that I get "Installed" button and a message to use purchases tab again and the app is not installed on Applications folder.
    On ML 10.8.0 Mac App Store was downloading and re-downloading these small apps adn the only way I found to solve this was pause the download, add the 8.8.8.8 to DNS and resume. I worked for some apps.
    On ML 10.8.2 Mac App Store behavior is a little different, I only get "Installed" button shortly after having hit "Install" and cannot even pause. After reboot I see an error message in red "An error has ocurred".
    This is not happenning on Snow Leopard, what the heck have they done??
    I tried all suggestions, reset Mac App Store, delete cache folder, I don't have any anti-virus running,
    What's happenning? This is reallly annoying...
    L.

  • #ref error when opening two linked worksheets at the same time

    Dear all,
    I've two workbooks (A and B) wich some cells are linked between them.
    The problem is that if I open A workbook, links works great taking the values from B, but if I open B (i mean, both workbooks opened at the same time), at the A workbook I see #ref error in the formula.
    If I manually replace #ref for its previuos value, (in this case is the name of the sheet) it works!
    I've several workbooks acting this way with several links between them, so replacing manually each time is not an option.
    Can someone help me please?
    Thanks in advance.

    Hi,
    First, please check whether the file extension is correct. If in Excel 2010, the file extension will be .xlsx, in Excel 2003, it will be .xls.
    This problem occurs if the workbook that you open was last saved in a version of Excel that is earlier than the version that you are currently using to open the
    workbook. This problem occurs because the newer version of Excel forces a complete recalculation of all open workbooks that were previously saved in an earlier version of Excel, regardless of the link update status. To fully recalculate a workbook, Excel forces
    updates of all external references. This behavior occurs even after you decide not to update those links when you are prompted. Excel updates the workbook calculation chain to the current version of Excel. If the external link sources are unavailable, Excel
    cannot calculate correctly. Therefore, Excel returns #REF! errors. This is also true of DDE links that are unavailable during the recalculation process.
    To work around this problem, use one of the following methods.
    Make sure that external link sources are available before you open the workbook
    Update or remove links
    Permanently remove the link formula, and then replace it with the value
    Quote from:
    http://support.microsoft.com/kb/925893
    Jaynet Zhang
    TechNet Community Support

  • Error while adding a second template to the same data definition

    Hi,
    I am quite new to XML Publisher. I am developing a report using XML Publisher.
    I have added one template to the Data Definition. When I tried to add another Template(with different name as previous, to the same concurrent program and application) to the same Data Definition I am getting the following error.
    Error: You entered a duplicate template entry. Please change the Name, Code and/or Application and reapply.
    Can anyone help me out solving this problem. I am reaching my deadline. Please suggest me what can be done.
    Regards,
    Sita

    Hi
    Try to change the Template code name also and then check it.
    Thanks
    Sudheer

  • BC email and recovery email are the same

    Client has setup his email account in BC and unfortunately his recovery email is the same as the BC email.  He is locked out of his email because he changed the password and cannot remember it.  Going through the password recovery or reset module is futile as he now has no way to access it.  I have created a support ticket for this issue.  Any other suggestions out there other than to delete and recreate the email account?
    Thank you.

    I can't use web service, only off line connection.
    I resolved it loading data from string xml harcoding and using xfa.dataset instead xfa.record.
    Example : var dataToLoad = "This is the new string";
    xfa.datasets.data.loadXML(dataToLoad,0,1);
    and then the submited is : the xml formed and the field of the form.
    I took from an example called : DataSaveXML.pdf
    I don't understand this : "These bindings are what is used to format the output when data is merged or saved in/out of the form"
    Why nobody else ask for something like that?is it an uncommon way to work?
    Javier

  • Lookup Table and Target Table are the same

    Hi All,
    I have a requirement in which I have to lookup the target table and based on the records in it, I need to load a new record into the target table.
    Being very specific,
    Suppose I have a key column which when changes I want to generate a new id and then insert this new value.
    The target table record structure looks like this
    list_id list_key list_name
    1 'A' 'NAME1'
    1 'A' 'NAME2'
    1 'A' 'NAME3'
    2 'B' 'NAME4'
    2 'B' 'NAME5'
    As shown the target table list_id changes only when the list key changes. I need to generate the list_id value from within OWB mapping.
    Can anyone throw some light as to how this can be done in OWB???
    regards
    -AP

    Hello, AP
    You underestimate the power of single mapping :) If you could tolerate using additional stage table (with is definitly recomended in case your table from example will account a lot of rows).
    You underestimate the power of single mapping :) It you could tolerate using additional stage table (witch is definitely recommended in case your table from example will account a lot of rows), you could accomplish all you need within one mapping and without using PLSQL function. This is true as far as you could have several targets within one mapping.
    Source ----------------------------------------------------- >| Join2 | ---- > Target 2
    |------------------------ >|Join 1| --> Lookup table -->|
    Target Dedup >|
    Here “Target” – your target table. “Join 1“ – operator covers operations needed to get existing key mapping (from dedup) and find new mappings. Results are stored within Lookup Table target (operation type TRUNCATE/INSERT).
    “Join 2” is used to perform final lookup and load it into the “Target 2” – the same as “Target”
    The approach with lookup table is fast and reliable and could run on Set base mode. Also you could revisit lookup table to find what key mapping are loaded during last load operation.
    Serhit

  • If the bill-to and ship-to are the same

    Hi everybody,
    Can somebody please help me with this? If I have both the bill-to and ship-to party as the same, how can I get that information as two different addresses etc in Sales. I am looking at the KNA1 table and I know I can use partner functions for this but I cannot figure out how to use them to get the information in one report as bill-to and ship-to if the information is the same.
    PLease somebody help.
    Thanks.

    IF it would help here is the code:
    DATA: l_kunnr LIKE vbpa-kunnr.
    SELECT kna1kunnr kna1name1 kna1stras kna1ort01 kna1regio kna1pstlz
    kna1brsch kna1erdat kna1ktokd kna1bran1 kna1~telf1
                     kna1telfx knvpparvw knvp~vkorg
                     knvp~vtweg
                     knvp~spart INTO
                     CORRESPONDING FIELDS OF TABLE
                     typ_tab FROM KNA1 JOIN knvp on
                     kna1~kunnr =
                     knvpkunnr where knvpparvw = 'Z3'.
    LOOP at typ_tab.
      WRITE: / typ_tab.
         WRITE:/ typ_tab-kunnr,typ_tab-name1,typ_tab-stras,   typ_tab-ort01,
                 typ_tab-regio, typ_tab-pstlz,'USA',
                 typ_tab-brsch, typ_tab-erdat, typ_tab-bran1, typ_tab-telf1,
                 typ_tab-telfx, typ_tab-parvw, typ_tab-vkorg,
                 typ_tab-vtweg, typ_tab-spart.
         SELECT kunnr INTO l_kunnr FROM VBPA
         WHERE kunnr EQ
         typ_tab-kunnr and parvw EQ 'RE'.
         ENDSELECT.
      WRITE: / l_kunnr.
         SELECT name1 stras ort01 regio pstlz INTO TABLE   typ_kna1 FROM
         kna1 where kna1~kunnr = l_kunnr.
         LOOP AT typ_kna1.
             WRITE:/ typ_kna1-name1,typ_kna1-stras,typ_kna1-  ort01,
                    typ_kna1-regio,typ_kna1-pstlz.
             WRITE:/.
        ENDLOOP.
    ENDLOOP.
    Thanks & regards,
    AM

Maybe you are looking for

  • Memory upgrade on a Satellite A100-912

    I own a Satellite a100-912 and I want to upgrade its memory! As it seems, this model supports only PC2-4200 DDR2 SODIMM modules (533 Mhz). Before bying a memory module that might regret, I want to know if there will be any compatibility issues if I u

  • Tool/Menu bar icons not active - Acrobat in BROWSER

    I have installed the SP1 update of windows 7.  I have the latest version of Acrobat 10. I also have the latest version EXPLORER (9) & FIRE FOX (4).  The PDF file comes into the BROWSER & the Acrobat icons (print, save) show up on the tool/menu bar bu

  • In SharePoint Calendar lists, fields [Start Time] and [End Time] do not exist at the Site Column level.

    <header style="box-sizing:border-box;color:#777777;line-height:1;font-size:13px;padding-right:46px;margin-bottom:3px;font-family:'Helvetica Neue', arial, sans-serif;"> </header> I'm doing SP app development and have the following problem. I need to c

  • Re-Install CS2 on Win VISTA but setup.exe now does not respond

    I successfully installed and ran my legal, registered CS2 Production Premium on two different Win VISTA 64 machines, first on my  original desktop, then my current laptop, which is what I now use. Each time,  CS2 installed OK. I had learned the "tric

  • Troubles Exporting Song List

    Here's my situation, I want to export my song list and I have songs with Chinese words in them. I could do it before, it appeared as if iTunes saved the .txt files in Unicode, but now I can't get it to work. All that shows up are question marks where