|
Change file description, title etc |
Débuté par Huib Preij, 18 juin 2008 11:12 - 7 réponses |
| |
| | | |
|
| |
Posté le 18 juin 2008 - 11:12 |
Hello, Besides the file name, path and extension, files have a description, a title etc. I want to read and change the description of file by wLanguage. Have anyone an idea? Thanks, Huib. |
| |
| |
| | | |
|
| | |
| |
Posté le 18 juin 2008 - 11:12 |
Hi Huib, you can use HListFile() with the HListdetail option to retrieve the caption of a file, but you cannot change it that way. FileList is string FileList = HListFile(HLstDetail) FileList than contains all files of the analysis separated by CR-characters. With ExtractString() you can get the data of one file. Again with ExtractString(...,3) you can get the caption of the file (and other stuff). |
| |
| |
| | | |
|
| | |
| |
Posté le 18 juin 2008 - 11:41 |
Hi Stefan, That's not what I want to know. I want to know the description of an INI-file, or and Excel document, or an PDf file tec. When you click right-mouse on each file an see the properties, then you see tile, author, description etc. I want to see and change that information by programming. Do I see you friday in Meer (Belgium)? Regards, Huib. |
| |
| |
| | | |
|
| | |
| |
Posté le 18 juin 2008 - 17:14 |
Hi Huib, I'm sorry but I can't help you with retrieving that information. I think you have to use API-calls, but do not know which API you need. I will be in Meer, Belgium this friday. See you there. |
| |
| |
| | | |
|
| | |
| |
Posté le 18 juin 2008 - 18:37 |
Huib, Getting extended file properties can be done like:
objShell, objFolder, objFolderItem are automation dynamic sFile is string; vFolder is Variant; i is int sFile=fSelect("", "", "Select a file...", "All Files (*.*)"+TAB+"*.*", "*.*", fselOpen+fselExist) vFolder=UncompleteDir(fExtractPath(sFile,fDrive+fDirectory)) sFile=fExtractPath(sFile,fFileName+fExtension) IF vFolder"" THEN objShell = new automation ("Shell.Application") objFolder = objShell>>NameSpace(vFolder) IF NOT objFolder=Null THEN objFolderItem = objFolder>>ParseName(sFile) IF NOT objFolderItem=Null THEN FOR i = -1 TO 41 Trace(objFolder>>GetDetailsOf(Null,i)+"- "+objFolder>>GetDetailsOf(objFolderItem,i)) END END Delete objFolderItem END Delete objFolder Delete objShell END Not much properties are writable, .DateModified and some more ( see MSDN) For setting some Office document properties have a look at the DSOFile.dll file -- Peter |
| |
| |
| | | |
|
| | |
| |
Posté le 19 juin 2008 - 14:28 |
Peter, Thanks. This is exactly what I want to know. But it's only half the solution. The other half is, how to edit, update the extended file properties. I searched a little bit in the MSDN, but I'm not a specialist in MSDN. Hopefully someone else can help me. It must be possible. Regards, Huib. |
| |
| |
| | | |
|
| | |
| |
Posté le 19 juin 2008 - 16:13 |
| |
| |
| | | |
|
| | |
| |
Posté le 30 juin 2008 - 01:46 |
Thanks Gianni, But this is rather complicated. But thanks. I started an other solution. Regards. Huib. |
| |
| |
| | | |
|
| | | | |
| | |
|