Results 1 to 3 of 3

Thread: want to save new folder as date

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2008
    Posts
    2

    want to save new folder as date

    hello,

    i'm trying to figure out how to use Word 2003 macros in order to automatically create folders while naming them today's date (ex. C:\17-06-2008), and save the active document in the new folder at the same time.

    it should be possible to save a number of documents every day in the 'present day' folder (without giving the message that the folder already exist).

    can anyone help me out?

    thanks

  2. #2
    Head Hunted anhn's Avatar
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    3,669

    Re: want to save new folder as date

    To make "date" folders in correct order, you should name it as yyyy-mm-dd.
    Code:
    Dim sFolder as string
    '...
    sFolder = "C:\" & Format(Date,"yyyy-mm-dd")
    If Dir(sFolder, vbDirectory) = "" Then
       MkDir sFolder
    End If
    • Don't forget to use [CODE]your code here[/CODE] when posting code
    • If your question was answered please use Thread Tools to mark your thread [RESOLVED]
    • Don't forget to RATE helpful posts

    • Baby Steps a guided tour
    • IsDigits() and IsNumber() functions • Wichmann-Hill Random() function • >> and << functions for VB • CopyFileByChunk

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2008
    Posts
    2

    Re: want to save new folder as date

    Thanks anhn

    I'll try that. Now I want to save the active document in that date folder. i keep getting errors.

Posting Permissions

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



Click Here to Expand Forum to Full Width