> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of $Bill Luebkert
> Sent: March 14, 2005 4:04 AM
> To: Jack D.
> Cc: Perl-Win32-Users@listserv.ActiveState.com
> Subject: Re: Changing summary information using DSOFile DLL 
> [was RE: adding a title to a file on windows]
> 
> Jack D. wrote:
> 
> > I did some more research and found out that you *can* use perl to 
> > change the summaryinfo/extended properties:
> 
> That's good except as near as I can tell that only works for 
> structured storage files like those from M$ Apps (like Excel, 
> Word, etc).

Hmm. I got it to work on those plus *.swf, *.txt, *.exe. I'm sure there must
be more. I tried a png but a normal Comments property isn't even accepted.
The main drawback from what I can see is that "something" must already be in
the properties already otherwise it dies with an error such as:

Win32::OLE(0.1403) error 0x80020009: "Exception occurred"
    in PROPERTYPUT "Comments" at dso.pl line 8

> 
> > 1) First you need to download and install the DSOFile DLL 
> from Microsoft:
> > 
> > http://tinyurl.com/5fvte
> > 
> > 2) Create a test file. I chose C:/test.txt.
> > 
> > 3) For some reason the script in #4 won't work unless there is at 
> > least
> > *something* saved in the summary information. So go to windows 
> > explorer and right click on the file, choose Properties and 
> click on the summary tab.
> > Change at least one of the listed properties.
> > 
> > 4) Run this script to change the "Comments" for this file.
> > 
> > use Win32::OLE;
> > use strict;
> > 
> > my $dso = Win32::OLE->new('DSOFile.OleDocumentProperties');
> > $dso->open("C:/test.txt",0,0); #open in write/default mode 
> my $suminfo 
> > = $dso->SummaryProperties; print "Current comments: ", 
> > $suminfo->{'Comments'},"\n"; $suminfo->{'Comments'} = "Do 
> you this new 
> > comment ". scalar gmtime; print "New comments: ", 
> > $suminfo->{'Comments'},"\n"; $dso->close(1); #Save before closing
> > 
> > 5) Write this in a loop to change the properties for 
> various files as 
> > you see fit.
> 
> 
> -- 
>   ,-/-  __      _  _         $Bill Luebkert    
> Mailto:[EMAIL PROTECTED]
>  (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
>   / ) /--<  o // //      Castle of Medieval Myth & Magic 
> http://www.todbe.com/
> -/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My 
> Perl/Lakers stuff)
> _______________________________________________
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to