Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

date

Status
Not open for further replies.

mayrou

Electrical
Joined
Jan 8, 2014
Messages
55
Location
TN
HELLO WORLD!

I'm trying to create a macro that generates "Date created" of a catia product!
as shown in the attached picture,
thank you :)
 
Capture5.PNG
 
Code:
Set fs = CreateObject("Scripting.FileSystemObject")
Set rep=fs.getDocument(filename)
txt=""
for each fich in rep.files
txt=txt & chr(10) & fich.name & " (créé le " & left(fich.DateCreated,8) & ")"
next
MsgBox txt,,"liste des fichiers du répertoire " & rep.name 

Dim fso, f_file
set fso = CreateObject("Scripting.FileSystemObject")
Set f_file = fso.GetFile(filename)
ShowFileInfo = "Fichier Modifié: " & f_file.DateCreated
MsgBox(ShowFileInfo)

but it dosn't work!!
 
Someting to start
Code:
Sub File_Info()
    Dim fso As New FileSystemObject
    Dim fls As Files
    
FolderName = "C:\Users\Alex\Desktop"

Set fls = fso.GetFolder(FolderName).Files
For Each fich In fls
        txt = txt & Chr(10) & fich.Name & " (créé le " & Left(fich.DateCreated, 8) & ")"
Next fich
MsgBox txt
                 
End Sub
 
In Script ..


Code:
Sub CATMain()
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
    
FolderName = "C:\Users\Alex\Desktop"

Set fls = fso.GetFolder(FolderName).Files
For Each fich In fls
        txt = txt & Chr(10) & fich.Name & " (créé le " & Left(fich.DateCreated, 8) & ")"
Next 
MsgBox txt
                 
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top