Naming document

R

Robert

When using a template, word automatically creates a
document with the name "document1". Is there a way to set
the name for the new document perhaps using autonew? I
want the document created based on the template to always
have the same name, say "holder". Thanks.
 
P

Peter Hewett

Hi Robert

You name the document at the time you first save it. Word ALWAYS creates new
documents with the name DocumentNNN, where NNN is a number. The document name
is irrelevant until you save it.

HTH + Cheers - Peter
 
J

Jay Freedman

Hi, Robert,

A document gets a name only by being saved. You can change the default for
the name Word suggests during the first save -- see
http://word.mvps.org/FAQs/MacrosVBA/SetDefFilename.htm.

I would steer away from automatically saving a document with a specific name
during AutoNew processing. What if you decide you don't want to keep this
version? If it's already been saved with that name, you then have to go to
the trouble of deleting the file, instead of just throwing away the document
and starting over.
 
R

Robert

The article you referenced does what I want. I'm not sure
how to implement the macro that the article suggests.
Should I use autonew to run the macro? Or autoclose? Then
the name "My Title" will be the default name if the user
uses "save as". Thanks.
 
J

Jay Freedman

Hi, Robert,

Yes, that code should go into an AutoNew macro, so the default name is
in place before the first save. You wouldn't want to put it into
AutoClose, because by then the user might have already saved the
document with a different name.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top