Re: Auto add Name & date to a document save name
- From: Philgr <philgr(at)btinternet.com(nospamplease)>
- Date: Sat, 20 May 2006 11:36:01 -0700
Thanx for the quick response Jay
Im a bit of out of my depth here, but i managed to follow your reply and
create a macro (my first ever) and link it to the drop down box to populate
the 'Properties - 'Title' Field so that when the document is saved the shift
selection is in the file name.
But i need to add the date the document is saved to the file name.
Within the Document template (shift Log) i have used 'Insert - Field -
Createdate' field within the log to display the date of the log followed by
the Shift selection dropdown box (this is where i have tied the macro to)
How do i tie the date to the file name also do i end up with the following
depending on the shift selection
01-01-05 First Shift.Doc
01-01-05 Back Shift.Doc
01-01-05 Weekend Shift.Doc
Thanks in advance
Phil G
"Jay Freedman" wrote:
The solution needs a couple of pieces of explanation..
- When a document is saved for the first time, if there's text in the
Title property (in the File > Properties dialog), that text is put
into the File Name box of the Save As dialog. The user could change it
there, but if they just hit the Save button that's what the file will
be named.
- You're going to need a macro in the template to put together the
date and the shift into a complete file name, and to stuff that into
the document's Title property.
- The macro, once it exists, can be chosen as the exit macro for the
dropdown. That means that when the user selects a shift and tabs or
clicks to the next field, the macro runs automatically. (To make this
work, the dropdown should be the first field in the form so that it's
selected when the new document opens. Otherwise the user could click
elsewhere and never enter the dropdown.)
- The code in the macro should be based on what's shown at
http://word.mvps.org/faqs/macrosvba/SetDefFilename.htm. You'll have to
modify it to take the value of the date (you didn't say where that is)
and the selection in the dropdown, which will be
Selection.FormFields(1).Result
and put those two strings together (using the & operator) to replace
the words "My title" that the example macro puts in the Title
property.
- To get started with a macro, see
http://www.word.mvps.org/FAQs/MacrosVBA/VBABasicsIn15Mins.htm and
http://www.gmayor.com/installing_macro.htm.
If you have trouble getting this working, post back. Include whatever
macro code you have so far, and explain what is or isn't working.
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
On Sat, 20 May 2006 06:16:02 -0700, Philgr
<philgr(at)btinternet.com(nospamplease)> wrote:
New here Hello
I am a complete novice so please be kind :)
I have created a template for a shift working handover log which will be
used twice a day. the log will be for a first shift and a back shift
When the Log is completed i want the document to be saved in the same way by
all users eg
01-10-05 firstshift.doc
or
01-10-05 backshift.doc
the templete that i have created has a drop down box to select the shift and
the date is added when the template is opened.
is it possible for this info to be automatically put into the file name for
saving ??
Hope this makes sense !
Thanx in advance
Phil G
- Follow-Ups:
- Re: Auto add Name & date to a document save name
- From: Jay Freedman
- Re: Auto add Name & date to a document save name
- References:
- Re: Auto add Name & date to a document save name
- From: Jay Freedman
- Re: Auto add Name & date to a document save name
- Prev by Date: Re: Auto add Name & date to a document save name
- Next by Date: Re: Drop-down list?
- Previous by thread: Re: Auto add Name & date to a document save name
- Next by thread: Re: Auto add Name & date to a document save name
- Index(es):