Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.comp.os.windows-xp    |    Actually wasn't too bad for a M$-OS    |    17,273 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 16,928 of 17,273    |
|    R.Wieser to All    |
|    vbscript: how to generate a FolderItem2     |
|    22 Jun 24 12:14:11    |
   
   XPost: alt.windows7.general   
   From: address@is.invalid   
      
   Hello all,   
      
   I found a smal script which uses the "GetDetailsOf" method of a "Folder3"   
   object to extract some properties of a file.   
      
   The thing is that the "GetDetailsOf" method expects a "FolderItem2" object   
   as its first argument.   
      
   And although the "Folder3" object allows iterating thru its children by   
   which it returns an "FolderItem2" object for each of its entries (files,   
   subfolders), I would like to inspect just a single file.   
      
   So, I need a method to convert a (full) filename into a "FolderItem2" object   
   (withor-without the aid of a "Folder3" object, which "GetDetailsOf" needs   
   anyway).   
      
   Does what I'm looking for even exists ? And if so, what does it look like ?   
      
   reference script:   
   - - - - - - - - - - - - - - - - - -   
   Set objDlg = WScript.CreateObject("Shell.Application")   
      
   '-- returns a Folder3 object   
   Set oNSFolder = objDlg.NameSpace(folderName)   
      
   '-- returns FolderItem2 objects   
   For Each oNSFile In oNSFolder.items   
      
    '-- the "Artist" property value   
    sProperty = oNSFolder.GetDetailsOf(oNSFile, 16)   
      
    ...   
   next   
   - - - - - - - - - - - - - - - - - -   
      
   Regards,   
   Rudy Wieser   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca