+ Reply to Thread
Results 1 to 5 of 5

Print file names on all printed excel and word files (hundreds, thousands)

  1. #1
    Registered User
    Join Date
    03-04-2009
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2003
    Posts
    3

    Print file names on all printed excel and word files (hundreds, thousands)

    I posted the following thread on the EXCEL MISC forum. User Cheeky Charlie suggested I post this in the programming board:

    I do computer forensic, accounting, and legal work. I have 1000's of excel files and word files that I need to print WITH their file names. This is very important. I know how to print out the 1000 files easily. But how do I get every file and document to print with it's file name?

    I know how to do this one by one--by inserting the name in excel and word via the header/footer option. But i have no clue how to do this in a "batch".

    The problem is also that when I print lets say 100 documents, it does not follow the order (alphabetical) listed in it's folder. If it was printed in the same order, I would just manually write the name of the document itself. I think there is an easier way?

    Any advice is appreciated. (My excel knowlege/level is probably advanced beginner).


    Per cheeky Charlie: You could use a macro using file scripting to cycle through files in a folder and apply a footer of &[file] automatically - probably ought to ask about this in the programming thread though, it's not totally straightforward.

    Per Martindwilson: i've had a look and apparantly this can be done in a class module, then save as xla and use as addin , unfortunately the script i foundwas written for a mac, and i couldnt get it to run on excel97.

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Print file names on all printed excel and word files (hundreds, thousands)

    Are you wanting to open each DOC file and put a header or footer, print and close without saving and then open each XLS and print some area with a header footer? XLS files can have many sheets so I am not sure what you want printed. Modifying a DOC file's header or footer may change the layout of the DOC.

    Will the files all be the same folder or subfolders or where?

    Printing multiple files like that can cause problems with printer queues. A routine that would wait for each to print might be best. Another idea is to create a text file with the filename to print. As each are printed, the filename would be removed from the text file or added to a new text file that you check against. That way, if things go amiss, you can start where it left off.

    You might think about using a Printer property that prints a cover sheet or Banner page with the filename. You can find that option in some Printer Properties if you right click the printer in your Control Panel.

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Print file names on all printed excel and word files (hundreds, thousands)

    this is where i found the code i couldnt get to work in excel 97
    http://www.mcgimpsey.com/macoffice/e...infooter2.html
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Registered User
    Join Date
    03-04-2009
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Print file names on all printed excel and word files (hundreds, thousands)

    Mr. Hobson,

    In my line of work, I need to identity the file name of each word document (doc), excel (xls) file, .txt file, .pdf file, etc., I print out.

    I don't want to manually open and insert the file name into each DOC or XLS file because I have 1000's of documents. I do want to automatically put a header or footer file name into each XLS and DOC file, print, and close the file.

    I know XLS files can have many sheets, but as long as I can print the title, I should be good. I know modifying a file's header or footer may change the layout of the document, but that would be a "minor" issue/problem.

    "Will the files all be the same folder or subfolders or where? " I have the files organized in folders based on the type of file:

    Excel files
    Word files
    .txt files
    .pdf files


    Thanks. I'll try to see if my program/printer can print a cover sheet with the filename. That seems to be the easiest and fastest way!

    Forensics

  5. #5
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Print file names on all printed excel and word files (hundreds, thousands)

    We could do it for xls and doc files. For the other types like pdf, it is not possible. You would need to use the Printer properties or create the pdf at run time. Headers and footers in text files would not be possible either.

    So, to do this for xls and doc files, create a macro that would modify one open file. The macro would then open a filename in excel or msword, and run the appropriate macro, print, and then close with or without saving the modified file.

    If you want to pursue the method above, let us know.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1