ironpaw has asked for the wisdom of the Perl Monks concerning the following question:
use Win32::OLE; use File::Spec; my $PropertyReader = Win32::OLE->new('DSOleFile.PropertyReader', 'Quit +'); my $directory = "c:\\temp"; opendir(DNAME, $directory) || die "Unable to open the requested direct +ory: $directory\n"; while( my $filename = readdir( DNAME ) ) { next if ($filename eq '.' or $filename eq '..'); my $fullfilename = File::Spec->catdir($directory,$filename); my $properties = $PropertyReader->GetDocumentProperties($fullfilename) + || die("Unable read file properties for '$fullfilename' ", Win32::OL +E->LastError()); if (0 == 0) #ok i was playing # if ( !$properties->{title} || length($properties->{title}) == 0) { $properties->SetProperty('title', "this one"; #why does this not work? +?? print $properties->title; } else { print "File '$filename' --- Title property is set to '" . $properties- +>{title} ."'\n"; } } closedir(DNAME);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Change doc properties
by poj (Abbot) on Jan 15, 2003 at 21:29 UTC |