ShellFolderItem question

ShellFolderItem question

Post by Jeff » Sat, 14 Jun 2003 06:45:16



I'm using a ShellFolderItem to look at the extended
properties of some files, and I can look at the title by
passing in "Title" as the argument to the
ShellFolderItem.ExtendedProperty function.  I can do the
same with "Author", etc.  What I want to know how to do is
get the revision number from this same list.  "Revision
Number" does not work.  I've tried various permutations of
this string, but I just can't seem to get it.  Thanks in
advance.

Jeff

 
 
 

ShellFolderItem question

Post by Jeff » Sun, 15 Jun 2003 01:11:17


In addition, I've also tried sending the summary info guid
and number combo in the form of:

FMTID_SummaryInfo="{F29F85E0-4FF9-1068-AB91-08002B27B3D9}"

string.Concat(FMTID_SummaryInfo, ",", i.ToString())

where i is a number that i've iterated to over a million,
then added it to the summary info string separated by a
comma.  This gets me nearly all the information from the
summary tab, but not the revision number.  This is driving
me mad!  If anyone has ever gotten the revision number
from this tab programmatically, please respond!

Quote:>-----Original Message-----
>I'm using a ShellFolderItem to look at the extended
>properties of some files, and I can look at the title by
>passing in "Title" as the argument to the
>ShellFolderItem.ExtendedProperty function.  I can do the
>same with "Author", etc.  What I want to know how to do
is
>get the revision number from this same list.  "Revision
>Number" does not work.  I've tried various permutations
of
>this string, but I just can't seem to get it.  Thanks in
>advance.

>Jeff
>.


 
 
 

ShellFolderItem question

Post by Jim Barr » Sun, 15 Jun 2003 01:23:01



> I'm using a ShellFolderItem to look at the extended
> properties of some files, and I can look at the title by
> passing in "Title" as the argument to the
> ShellFolderItem.ExtendedProperty function.  I can do the
> same with "Author", etc.  

Hmmm, I can't seem to get anything useful from ExtendedProperty at all; it always returns S_FALSE. How do you obtain your ShellFolderItem? (I went via Shell.NameSpace.ParseName)

Quote:> What I want to know how to do is
> get the revision number from this same list.  "Revision
> Number" does not work.  I've tried various permutations of
> this string, but I just can't seem to get it.  

Did you try using PIDSI_REVNUMBER, i.e. "{F29F85E0-4FF9-1068-AB91-08002B27B3D9},9"?

--
Jim Barry, MVP for Windows SDK
"For bureaucratic reasons, we settled on one issue, weapons of mass
destruction, because it was the one reason everyone could agree on."
Paul Wolfowitz, US Deputy Defence Secretary

 
 
 

ShellFolderItem question

Post by Jeff » Sun, 15 Jun 2003 01:34:40


I'm using C#, and I add a reference to the shell32.dll to
get the COM interfaces.  Shell32 is the namespace the
interop imports.

Shell32.Shell shell = new Shell32.ShellClass() ;

Shell32.FolderItem2 fi = null ;

string FMTID_SummaryInfo="{F29F85E0-4FF9-1068-AB91-
08002B27B3D9}" ;
string SCID_Something = "" ;

IEnumerator e = folder.Items().GetEnumerator() ;
while (e.MoveNext())
{
   fi = e.Current as Shell32.FolderItem2 ;

Quote:}

In that enumerated loop, I check for a file type (a text
document that I have changed all the summary information
properties), and I loop through all of the values by
concatenating the FMTID_SummaryInfo with a comma and a
number.

>-----Original Message-----

>> I'm using a ShellFolderItem to look at the extended
>> properties of some files, and I can look at the title
by
>> passing in "Title" as the argument to the
>> ShellFolderItem.ExtendedProperty function.  I can do
the
>> same with "Author", etc.  

>Hmmm, I can't seem to get anything useful from

ExtendedProperty at all; it always returns S_FALSE. How do
you obtain your ShellFolderItem? (I went via
Shell.NameSpace.ParseName)
Quote:

>> What I want to know how to do is
>> get the revision number from this same list.  "Revision
>> Number" does not work.  I've tried various permutations
of
>> this string, but I just can't seem to get it.  

>Did you try using PIDSI_REVNUMBER, i.e. "{F29F85E0-4FF9-

1068-AB91-08002B27B3D9},9"?
Quote:

>--
>Jim Barry, MVP for Windows SDK
>"For bureaucratic reasons, we settled on one issue,
weapons of mass
>destruction, because it was the one reason everyone could
agree on."
>Paul Wolfowitz, US Deputy Defence Secretary
>.

 
 
 

ShellFolderItem question

Post by js » Sun, 15 Jun 2003 02:41:48


Here is some crude VB.NET code that I created for a project needing
access to extended properties.  This fills the arrHeaders with the
list of available properties and then gets each property for each file
in the strFolder folder.  If this helps then great.

Dim i As Integer, arrHeaders(34) As Object
'Create reference to Shell application.
Dim objShell As New Shell32.Shell
'Create reference to the folder object for folder strFolder.
Dim objFolder As Shell32.Folder2 = objShell.NameSpace(strFolder)
'Get the property names that are available.
For i = 0 To 33
    arrHeaders(i) = objFolder.GetDetailsOf(objFolder.Items, i)
Next
'Loop over each file in the folder and display the properties and
property settings.
lstProps.Items.Clear()
For Each strFilename As Shell32.FolderItem2 In objFolder.Items
    For i = 0 To 33
        lstProps.Items.Add(String.Format("{0}--{1}--{2}", i,
arrHeaders(i), objFolder.GetDetailsOf(strFilename, i)))
    Next
Next


> I'm using a ShellFolderItem to look at the extended
> properties of some files, and I can look at the title by
> passing in "Title" as the argument to the
> ShellFolderItem.ExtendedProperty function.  I can do the
> same with "Author", etc.  What I want to know how to do is
> get the revision number from this same list.  "Revision
> Number" does not work.  I've tried various permutations of
> this string, but I just can't seem to get it.  Thanks in
> advance.

> Jeff

 
 
 

ShellFolderItem question

Post by Jim Barr » Wed, 25 Jun 2003 03:34:07



> I'm using a ShellFolderItem to look at the extended
> properties of some files, and I can look at the title by
> passing in "Title" as the argument to the
> ShellFolderItem.ExtendedProperty function.  I can do the
> same with "Author", etc.  What I want to know how to do is
> get the revision number from this same list.  "Revision
> Number" does not work.  

Well, my curiosity finally got the better of me and I looked into this a bit further. I found that the property name "Title" did not work for me, even though you say it works for you. I saw that the help for ExtendedProperty mentioned "DocTitle" and "Author" which struck me as highly suspicious, as the topic "The Summary Information Property Set" lists the names as "Title" and "Author".

Stepping into ExtendedProperty, I found that the input string was being looked up in a table. From this, I was able to come up with the following list of property names that return anything other VT_EMPTY for a Word document:

DocComments, DocPageCount, DocAuthor, DocSubject, DocTitle, DocCreatedTm, Access, Create, Owner, AttributesDescription, Write, Size, Type

The string table also contained "DocRevNumber" but passing that as the property name just returned VT_EMPTY. Moving on to the 'SCID' method of identifying properties, I found that ExtendedProperty is not looking for a comma delimited string at all. In fact it is expecting whitespace between the FMTID and the PID. I was able to retrieve the document title using PIDSI_TITLE ("{F29F85E0-4FF9-1068-AB91-08002B27B3D9} 2"). Sadly I was still unable to retrieve the revision number using PIDSI_REVNUMBER ("{F29F85E0-4FF9-1068-AB91-08002B27B3D9} 9").

In conclusion, this all seems to indicate that the ExtendedProperty method is rather poorly implemented and should be steered well clear of.

--
Jim Barry, MVP for Windows SDK
"For bureaucratic reasons, we settled on one issue, weapons of mass
destruction, because it was the one reason everyone could agree on."
Paul Wolfowitz, US Deputy Defence Secretary

 
 
 

1. Questions, questions, questions

Yo, I have two questions... how do ya change the xbox name
using Halo? or any other game? and secondly, does anyone
have ANY opinion on which controller is the best? is it
worth it paying xtra 10$ for the official controller? or
are thrid party controllers good enough for their value? I
have two official controllers and i am looking to get two
more so my friends (hoo unfortunately decidedto buy the
gamecube...i wont continue discussing that mistake) can
also play Halo w/ me instead of just one....

2. LoadPowerProfile Twice in Startup

3. Questions, questions, questions...

4. New products from MPE

5. Questions Questions

6. MIDI Output

7. questions....questions

8. Hook up question...dumb question cuz I'm an idiot.

9. Questions about OS4/Intel Re: Questions about OS4/Intel

10. Soundbox Question - Good question!

11. range question/date search question

12. A question about Silk questions!