Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro to save path name in footer

Status
Not open for further replies.
May 5, 2000
168
US
How do I get the full path of the document to print in the footer? It must be a built in funtion, but I can't find it. In Word or Excel. Thanks
 
I don't know of anyway to do this "automatically", and can only help you on the Excel part of your question, but I sometimes use an Excel macro. The named range HeaderPath has a formula :

=MID(CELL("filename",A1),1,FIND("[",CELL("filename",A1))-2)

The macro to shove this into the header is :

Var1 = Range("HeaderPath")
ActiveSheet.PageSetup.LeftHeader = Var1


However, 95% of the time, I just show the filename+sheet, date+time, and the page #'s, and show the path somewhere on the printout.
 
I know this is a little late, but I'm new here and I just read it! I also don't know how to get the full path in Excel using a built in feature (only the filename). They're both for Office 97.

Word - View, header and footer, Insert AutoText Button. Select "filename and path"

Excel - View, header and footer, Select either the custom header or custom footer button, there should be an icon that looks like an Excel spreadsheet-this inserts the filename only (&[File]). I haven't had an opportunity to try typing this into other apps/versions, so I don't know if it can be done without being "built-in".
 
You can try adding a WorkbookBeforePrint sub routine into a class module which will. The routine runs before the file is sent to the printer so adding JVFriederick's code to it will add a footer automatically. (Its probably a good idea to check out the Help file on this command using the Browser (F2).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top