How do I save a doc as the autofield eg "YYYYmmdd".doc

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When I open a template and fill it in I would like to save it as the auto
field in the top left corner of my document eg date auto field YYYYmmdd would
save as todays date eg 20070418.doc

Any help would be great
 
SG:

I don't know of any simple way to do what you ask. I mean, the manual way is
simply to copy the date and paste it into the File Name box when you do the
Save As.

If you're up for a macro solution, let me know, and I'll show you how. But I
won't go into it if you're not interested.

Bear

Windows XP, Word 2000
 
Provided the template does not contain text in the Title field of the file
Properties, Word will suggest the first text in the document (up to the
first line break or punctuation mark) as the filename. If your date is the
first text in the document, it will be suggested.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
Hi Bear
Thanks for the info I know how to create a macro already.
I was just wondering if it could use the auto field because MSw saves my
files as the first line it sees on the page eg my name but I wondered if it
could save as the auto field without all the palava of macros and pasting
etc..... just lazyness on my part I guess....... but annoying never the less
 
Palava follows ...

Dim strDate As String
Dim strName As String

strDate =
Format(expression:=ActiveDocument.BuiltInDocumentProperties(wdPropertyTimeCreated), Format:="yyyymmdd")
strName = strDate & ".doc"

ActiveDocument.SaveAs FileName:=strName, FileFormat:= _
wdFormatDocument, LockComments:=False, Password:="", AddToRecentFiles:= _
True, WritePassword:="", ReadOnlyRecommended:=False,
EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
SaveAsAOCELetter:=False
End Sub
 

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

Back
Top