Results 1 to 4 of 4
  1. #1
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727

    extracting pdf files question

    All, using access 2015. I have a multipage pdf that contains different letters. I have code to extract the letters to a folder from the database. All works well. But I have some pdf files that I created in January in a folder outside the database that I want to extract with a naming convention to identify the letters. Does anyone know how I would do this? She I import the files back into the database somehow and try to export again with the naming convention? I was hoping there may be a faster way because I think there would be a lot of set up otherwise. Thanks

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    I do not understand the question.

  3. #3
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727
    This is part of my code I'm trying:

    Code:
    DoCmd.OutputTo acOutputReport, "rptCustLetter", acFormatPDF, myPath & "\" & strReportName1, False
    I need to export "rptCustLetter" which is a multipage pdf into separate pages with a naming convention. I am having trouble setting it up to extract into separate pages. It exports without separating the pages.

    thanks

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    if you are talking about creating a separate report for each customer you would have to cycle through a recordset run the report then move to the next item in the recordset.

    so let's say you have a query that correctly identifies the clients that need a letter (let's call it qryClientList) you would have something like


    Code:
    dim db as databvase
    dim rst as recordset
    dim CustID as long 'assuming the customer id is the driving force and it's a number (autonumber) field
    
    set db = currentdb
    set rst = db.openrecordset(qryClientLIst)
    
    if rst.recordcount <> 0 then
        do while rst.eof <> true
            CustID = rst!custID
            'DO WHATEVER YOU'RE GOING TO DO WITH YOUR PDF CREATION HERE USING THE CUST ID FROM YOUR RECORDSET
            'You can set a filter 
            'OR build a SQL ROWSOURCE statement 
            'OR populate a field on a form with the client identifier to show who is currently being processed as it happens and use the field on the form as your criteria for a static query
        loop
    else
        msgbox "NO RECORDS IN RECORDSET", vbokonly, "BLAH BLAH"
    endif
    
    
    set db = nothing

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 11-11-2014, 12:18 AM
  2. Replies: 4
    Last Post: 05-15-2014, 12:49 PM
  3. Seaching for files question
    By fenderbender in forum Access
    Replies: 1
    Last Post: 08-02-2012, 02:11 PM
  4. Replies: 1
    Last Post: 02-21-2011, 09:55 PM
  5. Access Question regarding JPEG files
    By amosstarz in forum Security
    Replies: 1
    Last Post: 09-01-2006, 04:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums