Hi,
I try to read a folder content with this code :
Name DataType Subtype Length
fso Automation 'Windows Script Host Object Model'.FileSystemObject
folder Automation 'Windows Script Host Object Model'.Folder
files Automation 'Windows Script Host Object Model'.Files
file Automation 'Windows Script Host Object Model'.File
folder:=fso.GetFolder('\\lamsrv01\fileExchange\production\navToLalima\item');
files:=folder.Files;
MESSAGE(FORMAT(files.Count));
file:=files.Item(1);
MESSAGE(file.Name);
The first message work, I have the count but with the second I receive an error.
How I can get the file?? I have already try with the Microsoft Scripting Runtime, i get the same error.
I can't do with the table file of Navision, because the update of this table is n't quickly...
Thanks for your help
Comments
Maybe it gets you on the way.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
My Function:
getFiles(VAR _files : Automation "'Microsoft Scripting Runtime'.Dictionary";_directory : Text[250])
Name DataType Subtype Length
fso Automation 'Windows Script Host Object Model'.FileSystemObject
folder Automation 'Windows Script Host Object Model'.Folder
files Automation 'Windows Script Host Object Model'.Files
scr Automation 'Microsoft Script Control 1.0'.ScriptControl
txtCr Text 30
txtCode Text 250
i Integer
Call the function:
file Automation 'Windows Script Host Object Model'.File
filesCol Automation 'Microsoft Scripting Runtime'.Dictionary
i Integer