Newsgroups: comp.os.ms-windows.misc
Path: cantaloupe.srv.cs.cmu.edu!das-news.harvard.edu!noc.near.net!uunet!world!ewl
From: ewl@world.std.com (Erich W Lantz)
Subject: WordBasic time/date variables
Message-ID: <C6FL61.FLs@world.std.com>
Summary: Question about time/date vars under wordbasic
Keywords: Winword variable mail wordbasic macro
Organization: The World Public Access UNIX, Brookline, MA
Date: Mon, 3 May 1993 03:18:00 GMT
Lines: 32


I'm writing a mail management system using Word for Windows 2.0 as
a front end. The user dials up a remote system and downloads a batch
of mail as "foo.txt ." I've set up an AutoExec macro in Winword to load
"foo.txt" OK, but subsequent invocations of the macro will of course
pose file name contention problems.

What I'd really like to do is to create an AutoExit macro in Winword
that would move "foo.txt" to a specified directory, rename it using
the current date and time, and delete the original "foo.txt ."

In other words, "foo.txt" gets renamed as "5012300", say, on May 1
at 23:00- the user gets a time-indexed backup of his mail files and
"foo.txt" is freed up for the next packet of mail, since my AutoExec
macro points to it.

My main question is this: 

How may one rename a file from within a WordBasic macro to include a 
time/date variable in the new filename? 


Thanks-

=======================================================================
  "If you ever reach total enlightenment while drinking a beer,
   I bet it makes beer shoot out of your nose." -- Jack Handey
-----------------------------------------------------------------------
   Erich W. Lantz | ewl@world.std.com | Timberville, VA | DoD #0815
=======================================================================
   

