Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Aug 2001
    Location
    London, UK
    Posts
    516
    Thanks
    0
    Thanked 0 Times in 0 Posts

    macro to auto save document at the end of the day (MS word 2000)

    Hiya,
    I have a mail merged document which extracts data from a Microsoft access query according to the date (Date()), which means that the data displayed on the mail merged documents varies every day. What I want to do is save this document everyday for future reference using a macro. I want the user to be able to press a button and the name of the document should be entered automatically, which should be

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: macro to auto save document at the end of the day (MS word 2000)

    You could use the following code : <pre>Sub SaveByDate()
    Dim strFileName As String
    strFileName = "Class " & Format(Now, "DDMMYYYY") & ".doc"
    ActiveDocument.SaveAs FileName:="C:My Documents" & strFileName, _
    FileFormat:= wdFormatDocument
    End Sub</pre>


    You may wish to change the directory from C:My Documents to something more suitable. As the code is it saves the file as
    <font color=red>Class 28082001.doc</font color=red>, but you can also change the date format by adjusting DDMMYYYY, e.g change it to MMDDYY or whatever suits your purpose.

    Andrew C

  3. #3
    4 Star Lounger
    Join Date
    Aug 2001
    Location
    London, UK
    Posts
    516
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: macro to auto save document at the end of the day (MS word 2000)

    Hi Andrew, I tried to run the macro but it is giving me the following error message:

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •