You can do it with dsofile.dll (you can download for free from Microsoft
site)

 

Install the files, then import the dll from Delphi, here is a snipet

 

 

unit Unit1;

 

interface

 

uses

  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

  StdCtrls, ComObj, ActiveX, ExtCtrls, FileCtrl,

  Buttons, DSOFile_TLB;

 

 

type

  TFMain = class(TForm)

     ……

  private

    valor :string;

    od: _OleDocumentProperties;

    sp: SummaryProperties;

    cp: CustomProperty;

  public

    { Public declarations }

  end;

 

procedure TFMain.btSetpropClick(Sender: TObject);

begin

       //open the file 

       od.Open(FileListBox1.filename, true, dsoOptionDefault);

      if od.IsOleFile then

      begin

        sp := od.SummaryProperties;

        showmessage(sp.Title);

         

        //edit the property       

        sp.Title := ‘my title’;                   

         

        od.save;

        od.Close(False);

end;

 

you can even use your custom properties 

 

od.CustomProperties.Get_Count

cp := od.CustomProperties.Item[0];

if cp.Type_ = dsoPropertyTypeString then

// you can’t edit custom properties, you must delete and add the item again

cp.Remove;

od.CustomProperties.Add(WideString('Aplicación'), EdAplicacion.text);

od.save;

od.Close(False);

 

  _____  

De: [email protected] [mailto:[EMAIL PROTECTED] En nombre
de Andries Bos
Enviado el: Jueves, 21 de Diciembre de 2006 04:38
Para: delphi advanced group
Asunto: [delphi-en] editing file properties from within delphi

 

Within Windows one could read and edit file properties. These properties
include title, author, comments, revision number etc.

Does anyone know how the edit/ set these fields. i would like to use the
comment field.

thanks in advance

andries

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around 
http://mail. <http://mail.yahoo.com> yahoo.com 

[Non-text portions of this message have been removed]

 



[Non-text portions of this message have been removed]

Reply via email to