Need help finding a script.

ZoomerZoomer Member Posts: 126
Does anyone know of a place to find one or can give me a script that would print all documents in a specific location and include the file name in it? I need to print like 5000 documents, mostly 1 page Word docs including excel files. Don't ask me why, it's complicated... icon_wink.gif

Or is there a program that can do this already?

Comments

  • ClaymooreClaymoore Member Posts: 1,637
    Are you trying to print all of the documents or just a list of the documents in that location?
  • LuckycharmsLuckycharms Member Posts: 267
    Depending on the answer to that question and time restraints.. I might be able to come up with something... assuming you are running an os that runs VBscript...
    The quality of a book is never equated to the number of words it contains. -- And neither should be a man by the number of certifications or degree's he has earned.
  • ZoomerZoomer Member Posts: 126
    Just all the documents in a single location. There's like 2500 in one location and another 2500 or so in another. I just need to print them out and have a little tag on the bottom of the doc showing the file name. Running on Windows XP/Server 2003
  • LuckycharmsLuckycharms Member Posts: 267
    Do you need it to print to your local default printer or... another printer??? ( easier if you print it to you local default...)
    The quality of a book is never equated to the number of words it contains. -- And neither should be a man by the number of certifications or degree's he has earned.
  • LuckycharmsLuckycharms Member Posts: 267
    Ok first off I am not responsable for anything this does... ( TEST IT FIRST on a small Directory)

    What you need to do...

    first open a notpad ...
    Second copy all code into notpad... ( change the Targetfolder to the folder you want printed)
    Third save the file as print.vbs
    Fourth double click icon and prepare to print....

    Report any problems you might have... I tested but only on a folder with 5 files... ( if you need me to change it so that it outputs a file tell you what files have printed I can do that too...


    '/=====================================
    '/   Created By: Lucky
    '/
    '/   Description: Print all files in folder
    '/
    '/======================================
    
    
    
    TargetFolder = "C:\Temp"  ' This is the searched/printed  Directory....
    
    
    Set objShell = CreateObject("Shell.Application")
    Set objFolder = objShell.Namespace(TargetFolder) 
    Set colItems = objFolder.Items
    For i = 0 to colItems.Count - 1
        colItems.Item(i).InvokeVerbEx("Print")
    Next
    
    The quality of a book is never equated to the number of words it contains. -- And neither should be a man by the number of certifications or degree's he has earned.
  • ZoomerZoomer Member Posts: 126
    That worked great! Is there any possible way to get the filename on the bottom of the documents? Thanks for the script!! :)
  • LuckycharmsLuckycharms Member Posts: 267
    It should have printed on the top of each page... did it not???
    The quality of a book is never equated to the number of words it contains. -- And neither should be a man by the number of certifications or degree's he has earned.
  • astorrsastorrs Member Posts: 3,139 ■■■■■■□□□□
    Here you go (with filename at the bottom and building off lucky's):
    ' This is the searched/printed directory - no trailing slash
    TargetFolder = "C:\temp"

    Set objWord = CreateObject("Word.Application")
    objWord.Visible = True

    Set objShell = CreateObject("Shell.Application")
    Set objFolder = objShell.Namespace(TargetFolder)

    For Each strFileName in objFolder.Items

    Set objDoc = objWord.Documents.Open(TargetFolder & "\" & objFolder.GetDetailsOf(strFileName, 0))

    Set objRange = objDoc.Sections(1).Footers(1).Range
    Set objField = objDoc.Fields.Add(objRange, 29)

    objDoc.PrintOut()
    objDoc.Close Flase

    Next

    objWord.Quit
  • LuckycharmsLuckycharms Member Posts: 267
    Sorry didn't read your post correctly.... As for printing the file name on the bottom rather then the top... I am pretty sure you can go into your default printer settings and change that... As for the script doing it.. I am not actually telling it to print the file name...( it does it by default.) Hope that helps...


    --- :D or you can do that...---
    The quality of a book is never equated to the number of words it contains. -- And neither should be a man by the number of certifications or degree's he has earned.
  • ZoomerZoomer Member Posts: 126
    This is great! Thanks everyone for the help. You guys rock!
Sign In or Register to comment.