PC Review


Reply
Thread Tools Rate Thread

Automatic Date Stamping

 
 
Risky Dave
Guest
Posts: n/a
 
      4th Apr 2008
Hi,

I have a macro that works out of an XL file which populates a Word template
with charts.

The macro then saves the template with a new name, using:

With WDDoc
.SaveAs ("C:\MyReport.doc")
End With

Is it possible to save the file with a custom date stamp (yyddmm) so that
the file would be called something like "080404 MyReport.doc"

I can then run the report the next day to produce 080405 MyReport.doc and so
on.

TIA

Dave

 
Reply With Quote
 
 
 
 
Ivyleaf
Guest
Posts: n/a
 
      4th Apr 2008
On Apr 5, 12:01*am, Risky Dave <RiskyD...@discussions.microsoft.com>
wrote:
> Hi,
>
> I have a macro that works out of an XL file which populates a Word template
> with charts.
>
> The macro then saves the template with a new name, using:
>
> With WDDoc
> * * * * .SaveAs ("C:\MyReport.doc")
> * * End With
>
> Is it possible to save the file with a custom date stamp (yyddmm) so that
> the file would be called something like "080404 MyReport.doc"
>
> I can then run the report the next day to produce 080405 MyReport.doc and so
> on.
>
> TIA
>
> Dave


Hi Dave,

You almost answered your own question! Just change

.SaveAs ("C:\MyReport.doc")

to

.SaveAs ("C:\" & Format(Date(),"yyddmm") & " MyReport.doc")

Cheers,
Ivan.
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic date stamping =?Utf-8?B?UEs=?= Microsoft Excel Misc 16 13th Dec 2009 10:04 PM
date stamping =?Utf-8?B?bGRz?= Microsoft Access Database Table Design 1 21st Mar 2007 10:47 PM
Date-stamping Michael Microsoft Excel Discussion 3 23rd Dec 2006 10:49 AM
Date stamping gb Microsoft Access 2 23rd Dec 2004 01:02 PM
date stamping Dawn Microsoft Access Getting Started 1 1st Oct 2003 04:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:03 PM.