Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross 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
Jan 8, 2014
55
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 :)
 
Replies continue below

Recommended for 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

Top