Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts

    File date (Word XP)

    We want to open a batch of documents (based on folder location), remove a code from the footer, save and close the document. We would like to be able to get the original date of the file, and after it's modified and re-saved, apply that original date to the file. Can we use the File System object to do that?

    Thanks,
    Richard Barrett

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: File date (Word XP)

    Do you mean the last modified date of the files as shown in Windows Explorer? The DateLastModified property of the File object in the Scripting Runtime library (the one that contains the FileSystemObject) is read-only. You need Windows API functions set the last modified date. See Change a File's Last Modified Date Stamp

  3. #3
    3 Star Lounger
    Join Date
    Feb 2003
    Location
    Runcorn, Cheshire, United Kingdom
    Posts
    372
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: File date (Word XP)

    Depending on how many documents there are and how many dates you'll be dealing with, you may find it simpler to manually set the PC system date back to the 'last modified date' before amending the files.

  4. #4
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts

    Re: File date (Word XP)

    Yes, that's what I meant. I just gave the code a try, and it worked beautifully.

    Thank you!
    Richard

Posting Permissions

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