Consulting

Results 1 to 4 of 4

Thread: Solved: extracting file creation time

  1. #1
    VBAX Regular
    Joined
    Jun 2004
    Location
    New Jersey
    Posts
    52
    Location

    Solved: extracting file creation time

    I wrote a macro that reformats a word doc. and would like to add to the bottom of the document the time it was created. Can this be done with VBA.
    Russ

  2. #2
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    Hi Russ,

    You need to Insert a Field of CreateDate. I just recorded this - it was easier thn coding it ..

    [VBA]Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
    "CREATEDATE \@ ""dd/MM/yyyy HH:mm:ss""", PreserveFormatting:=True[/VBA]
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

  3. #3
    VBAX Regular
    Joined
    Jun 2004
    Location
    New Jersey
    Posts
    52
    Location
    Thanks Tony I will give it a try and let you know how I make out.

    Russ
    Russ

  4. #4
    VBAX Regular
    Joined
    Jun 2004
    Location
    New Jersey
    Posts
    52
    Location
    Tony

    Thanks, I tried this out today and it works fine. I will have to play with it to make it work the way I would like, but it does the trick.
    Thanks again
    Russ

Posting Permissions

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