none
Moving and Renaming PDF Files as They're Created RRS feed

  • Question

  • Windows OS: 7

    Outlook / Excel 2010

    Legacy General Ledger System

    I've created a routine that runs my monthly inventory reports automatically using a lot of SendKeys to navigate the Ledger System.  All of that works fine.

    In the process of running the monthly reports, PDF Report copies of the reports are created and moved to a system directory by the legacy system.  The files are numbered in a numerical order 1546-1 .. 1547-1 .. 1548-1, etc.  When I was doing this process manually, I was copying the files to a Monthly Close Directory and renaming the files accordingly, i.e Open Orders, Finished Goods, etc..  I was thinking that I could capture the Start Time when the code starts, and filter the system directory for any files created after that start time and move them to another directory.

    Since these files are numbered numerically, and I know what order the reports are being created in, I was trying to think of a way of moving them and renaming them to what the report is AFTER all the reports were run.  I'm saying after because there is sometimes a network lag before the files show up in the system directory.  My thinking was as the Code is running, that I could somehow run an Excel file creating a numbering list (1,2,3 in column A, and in column B the title of the report that I would rename it to), and then at the end after confirming all the files are available in the system directory, run a move and renaming macro.

    The structure of my VBA code is broken in to sub-routines (mainly because of the numerous SendKeys commands and trouble shooting simplicity). Each sub-routine could run anywhere from 1 to 5 reports.

    The PDF reports are created starting with OPENORDERS and ending with WIPINVENTORY.

    Any thoughts, questions, or suggestions, please let me know.  Code is below.

    JMData Consultant 

    Sub InventoryBackUp()
        ISCAPSLOCKON
        ExcelFinishedGoods
        ExcelRawMaterials
        ExcelOpenOrders
        ExcelWIPInventory
        OPENORDERS
        FINISHEDGOODS
        RAWMATERIALS
        TRANSLOGS
        WIPINVENTORY
        exitvff
        SCHEDULENEXTTASK
    End Sub

    Thursday, October 17, 2013 7:20 PM

All replies

  • Hi,

    >>I was thinking that I could capture the Start Time when the code starts, and filter the system directory for any files created after that start time and move them to another directory. <<

    Is it your requirement? Do you want to copy and rename the PDF file to another directory after the reports are created?

    Since the code you provide have much sub-routines. I'm not sure about the inner structure of it.

    This forum is used to discuss the problem of the Office Development Technology. Though you provide much explain about the background, but I'm not sure about the situation.

    To get more efficient responses, I suggest you to give more detail information about the technology you want.

    Friday, October 18, 2013 12:38 PM
  • It is my requirement.  I want to rename the PDF Files to another directory after the reports have been created.

    I don't believe the subroutines are relevant as all the code is just sending instructions via SendKeys commands to a non-windows based program running the company's legacy ledger system.  While the reports are being run from the legacy system, there is no way of altering the name or destination that the files get saved to.

    The situation is that I'm trying to automate this process using Outlook and VBA Code to schedule the reports to run on specific dates and times, and I need to move the resulting PDF files into another directory and rename them.

    Friday, October 18, 2013 3:55 PM