Question

I'm trying to get sonme information from the details page of a file properties dialogue box.

For example:

file properties details page

I'm just after the two underlined dates for now.

I have searched and found some code in the thread here:

a thread on the Tek-Tips forums

and I've found other code around which looks very similar to the code in that thread.

I grabbed that code and made a little application to check it - the code in the button handler is:

procedure TfmMain.Button1Click(Sender: TObject);
var
  fnp: string;
  bb: boolean;
  ss: string;
begin
  fnp := 'c:\temp\aaaa.doc';

  bb := IsNTFS(fnp);

  if bb then
    moOne.lines.add('Yes, it is NTFS')
  else
    moOne.lines.add('No, it is not NTFS');

  ss := GetFileSummaryInfo(fnp);
    moOne.lines.add(ss);
end;

The NTFS check works fine, my file system is reported as NTFS, but I get the following OLE error

Project raised exception class EOleSysError with message 'OLE error 80030002'

Stepping through, this occurs on the line:

OleCheck(PropSetStg.Open(FmtID_SummaryInformation,
      STGM_READ or STGM_SHARE_EXCLUSIVE, PropStg));

in the code I linked to on the Embarcadero forums.

What am I doing wrong?

I'm using Delphi 5 on Win 7 64 bit.

No correct solution

OTHER TIPS

That COM error code is STG_E_FILENOTFOUND. So, on the face of it, it would seem that the summary information property set does not exist for that document.

From what I can tell, the getter function in that code does not work, but the setter function does. So you are not doing anything, but I think the code you are trying to use does not work as advertised.

I have found some code that does work ... the example shows how to get the document title, subject, author, comment, revision, application, creation date and word count. I've tried it on a few MSWord documents and the information fetched is correct.

It can be found here:

fourm.sources.ru file details code thread

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top