Make file path for all Microsoft Document (Word, Excel, Powerpoint)

Is there anyway to make the system print file path for all document(old and new).

We're using Office 2010 with Windows 7 Pro.

Thanks.
LVL 9
pcchiuAsked:
Who is Participating?
 
xtermieCommented:
that is what I am saying.
Since you are doing it to the new files via template, you have to do it to the old files via a macro
Do you want me to write this macro (ie that will open all Word, Excel, PPT documents in a path and add the file path to the header of each document, save and close?)

Let me know
0
 
xtermieCommented:
you can add this info to the header of the document if you want via a macro
do you have any type of Office files in the folder?
0
 
pcchiuAuthor Commented:
I know I can do it via a footer or header for the new document or manually apply it via a macro.

However I want to apply that to all existing document without the macro, is it something can be done on the printer or?

I only need that for Word, Excel, Powerpoint.

Thanks.
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
xtermieCommented:
You can definetely add this info in the header or footer of the files
Here is a snippet that will list all files in a directory
We can tweak the code to open any .doc files and add a header or footer with the info you want
Same for .xls files
LMK what you want more specifically and we can work on this.
Sub ListFilesinFolder()
Dim Test, sPath As String
Dim folder, oFSO As Object
On Error Resume Next
 
Set wbCodeBook = ThisWorkbook
sPath = "C:\Test\" 'your path
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set folder = oFSO.GetFolder(sPath)
  If folder = "" Then
      MsgBox "No Folder parameter was passed"
  End If
  Set folder = fso.GetFolder(sFolder)
  Set files = folder.files
  
  For Each folderIdx In files
    MsgBox folderIdx.Name
  Next
End Sub

Open in new window

0
 
xtermieCommented:
You can print lists of files with any of the following ways:
http://www.makeuseof.com/tag/5-ways-to-print-folder-and-directory-contents-in-windows/

If you want the info on each file printout, I can not think - at least for now- of a way apart from running a macro and adding automatically the info you want in the header or footer
0
 
pcchiuAuthor Commented:
I just need to print the file path for each document print out inside the document.
For example:  
I print a word document and the file on the desktop then on the footer...  I can do it for all new document via template however not sure how to do it for the existing file without user action...
0
 
pcchiuAuthor Commented:
I think there's no other choice and just need to make it via macro and apply it manually per each file then.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.