Reply
 
Thread Tools Display Modes
  #1   Report Post  
Mike Uy
 
Posts: n/a
Default Printing the Filename of Document on Multiple File Select

I have around 50 documents that I need to print. I plan to select all the 50
documents in Windows Explorer and print it from there (right click and hit
print).

I need the filename of each document printed accordingly.

Is there a way I can set the default template of Word (normal.dot) to
include printing of the filename of the document? Or any other suggestion?
  #2   Report Post  
Shauna Kelly
 
Posts: n/a
Default

Hi Mike

In this context, I'm not sure what "accordingly" means.

Do you want to produce one document that contains the names of all your
documents? If so, see
How can I print a list of My Documents, or the contents of any folder?
http://www.word.mvps.org/FAQs/General/PrintDocList.htm.

Or, do you want to print the file name within the text of each file (for
example, in the footer)? If so, then you will need to edit each document and
insert the file name. For example, to put the file name in the footer, do
View Headers and Footers. On the Header and Footer toolbar, click "Switch
between Header and Footer". Now, click Insert AutoText and choose Filename
or Filename and path.

To avoid doing this 50 times, once for each document, you could automate it
using VBA. To give you a start in creating the loop to get to each document
in a folder, see
Find & ReplaceAll on a batch of documents in the same folder
http://www.word.mvps.org/FAQs/MacrosVBA/BatchFR.htm

For what it's worth, changing normal.dot or any other template won't have
any effect. Once a document is created, its only remaining link to its
parent template is that the document can access the parent template's
macros, autotexts, toolbars and keyboard shortcuts. For more information
about that, see
What is the relationship between a Word document and its template?
http://www.ShaunaKelly.com/word/temp...ons\index.html

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word


"Mike Uy" Mike wrote in message
...
I have around 50 documents that I need to print. I plan to select all the
50
documents in Windows Explorer and print it from there (right click and hit
print).

I need the filename of each document printed accordingly.

Is there a way I can set the default template of Word (normal.dot) to
include printing of the filename of the document? Or any other suggestion?



  #3   Report Post  
Kristen
 
Posts: n/a
Default

Hi Shauna and Mike,

This was very helpful as I'm wanting to do the same thing. I'm wanting to
do what Shauna mentions below and have reviewed and implementing the VBA
script:

" Or, do you want to print the file name within the text of each file (for
example, in the footer)? If so, then you will need to edit each document and
insert the file name. For example, to put the file name in the footer, do
View Headers and Footers. On the Header and Footer toolbar, click "Switch
between Header and Footer". Now, click Insert AutoText and choose Filename
or Filename and path.

To avoid doing this 50 times, once for each document, you could automate it
using VBA. To give you a start in creating the loop to get to each document
in a folder, see
Find & ReplaceAll on a batch of documents in the same folder
http://www.word.mvps.org/FAQs/MacrosVBA/BatchFR.htm"


My question is that when the Find/Replace diaglogue box comes up, what do I
enter in the Find/Replace area so that the directory path shows up in the
footer area of each document?

Thanks in advance!
Kristen

"Shauna Kelly" wrote:

Hi Mike

In this context, I'm not sure what "accordingly" means.

Do you want to produce one document that contains the names of all your
documents? If so, see
How can I print a list of My Documents, or the contents of any folder?
http://www.word.mvps.org/FAQs/General/PrintDocList.htm.

Or, do you want to print the file name within the text of each file (for
example, in the footer)? If so, then you will need to edit each document and
insert the file name. For example, to put the file name in the footer, do
View Headers and Footers. On the Header and Footer toolbar, click "Switch
between Header and Footer". Now, click Insert AutoText and choose Filename
or Filename and path.

To avoid doing this 50 times, once for each document, you could automate it
using VBA. To give you a start in creating the loop to get to each document
in a folder, see
Find & ReplaceAll on a batch of documents in the same folder
http://www.word.mvps.org/FAQs/MacrosVBA/BatchFR.htm

For what it's worth, changing normal.dot or any other template won't have
any effect. Once a document is created, its only remaining link to its
parent template is that the document can access the parent template's
macros, autotexts, toolbars and keyboard shortcuts. For more information
about that, see
What is the relationship between a Word document and its template?
http://www.ShaunaKelly.com/word/temp...ons\index.html

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word


"Mike Uy" Mike wrote in message
...
I have around 50 documents that I need to print. I plan to select all the
50
documents in Windows Explorer and print it from there (right click and hit
print).

I need the filename of each document printed accordingly.

Is there a way I can set the default template of Word (normal.dot) to
include printing of the filename of the document? Or any other suggestion?




  #4   Report Post  
Shauna Kelly
 
Posts: n/a
Default

Hi Kristen

In order to write VBA code to put a file name field in the footer of each
document in a folder, you would need to do two things:

1. Work out how to access each file in a folder, open it, and do something
to it.
2. Work out how to insert the filename field where you want it (ie do the
"something" from step 1).

The link to the article at
http://www.word.mvps.org/FAQs/MacrosVBA/BatchFR.htm was intended to provide
an example of how to do step 1; that is how to cycle though all the files in
a folder to do something to them. It won't do step 2.

The code for step 2 would depend on what, exactly, you want to do. Does the
file name have to go in the header or footer? In the first section, last
section or all sections of the document? Or maybe only the first page only?
Should it replace or be added to any existing header or footer. How should
it be formatted? And so on.

Try recording a macro to do what you want. See:
Creating a macro with no programming experience using the recorder

http://www.word.mvps.org/FAQs/Macros...ngRecorder.htm

and
How to modify a recorded macro
http://www.word.mvps.org/FAQs/Macros...ordedMacro.htm

If you need more help, try one of the Word VBA newsgroups such as
microsoft.public.word.vba.general.

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word


"Kristen" wrote in message
...
Hi Shauna and Mike,

This was very helpful as I'm wanting to do the same thing. I'm wanting to
do what Shauna mentions below and have reviewed and implementing the VBA
script:

" Or, do you want to print the file name within the text of each file
(for
example, in the footer)? If so, then you will need to edit each document
and
insert the file name. For example, to put the file name in the footer, do
View Headers and Footers. On the Header and Footer toolbar, click
"Switch
between Header and Footer". Now, click Insert AutoText and choose
Filename
or Filename and path.

To avoid doing this 50 times, once for each document, you could automate
it
using VBA. To give you a start in creating the loop to get to each
document
in a folder, see
Find & ReplaceAll on a batch of documents in the same folder
http://www.word.mvps.org/FAQs/MacrosVBA/BatchFR.htm"


My question is that when the Find/Replace diaglogue box comes up, what do
I
enter in the Find/Replace area so that the directory path shows up in the
footer area of each document?

Thanks in advance!
Kristen

"Shauna Kelly" wrote:

Hi Mike

In this context, I'm not sure what "accordingly" means.

Do you want to produce one document that contains the names of all your
documents? If so, see
How can I print a list of My Documents, or the contents of any folder?
http://www.word.mvps.org/FAQs/General/PrintDocList.htm.

Or, do you want to print the file name within the text of each file (for
example, in the footer)? If so, then you will need to edit each document
and
insert the file name. For example, to put the file name in the footer, do
View Headers and Footers. On the Header and Footer toolbar, click
"Switch
between Header and Footer". Now, click Insert AutoText and choose
Filename
or Filename and path.

To avoid doing this 50 times, once for each document, you could automate
it
using VBA. To give you a start in creating the loop to get to each
document
in a folder, see
Find & ReplaceAll on a batch of documents in the same folder
http://www.word.mvps.org/FAQs/MacrosVBA/BatchFR.htm

For what it's worth, changing normal.dot or any other template won't have
any effect. Once a document is created, its only remaining link to its
parent template is that the document can access the parent template's
macros, autotexts, toolbars and keyboard shortcuts. For more information
about that, see
What is the relationship between a Word document and its template?
http://www.ShaunaKelly.com/word/temp...ons\index.html

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word


"Mike Uy" Mike wrote in message
...
I have around 50 documents that I need to print. I plan to select all
the
50
documents in Windows Explorer and print it from there (right click and
hit
print).

I need the filename of each document printed accordingly.

Is there a way I can set the default template of Word (normal.dot) to
include printing of the filename of the document? Or any other
suggestion?






Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I get multiple Excel rows merged into Word document when .. sebmailmerge Mailmerge 2 April 20th 05 03:47 PM
Moving templates to other computer GeorgeMar Microsoft Word Help 10 February 19th 05 04:59 AM
Word mail merged document by email as attached file. srmohsen Mailmerge 1 January 31st 05 10:37 AM
Endnote references in a document and in multiple appendices Wallace Microsoft Word Help 1 November 30th 04 02:11 PM


All times are GMT +1. The time now is 01:10 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"