RE: Accessing Extended File Attributes - Word Document
by Jan Dubois other posts by this author
Oct 30 2009 6:19PM messages near this date
Accessing Extended File Attributes - Word Document
|
system/backticks output not as expected
I've used the DSOFILE component from Microsoft in the past to access Office document propert
ies:
http://support.microsoft.com/kb/224351
You'll have to try it yourself to see if it still works under Windows 7 or not.
Cheers,
-Jan
From: activeperl-bounces@[...].com [mailto:activeperl-bounces@[...].com] On Behalf Of Tim Mo
or
Sent: Friday, October 30, 2009 4:24 PM
To: activeperl@[...].com
Subject: Accessing Extended File Attributes - Word Document
Hi there, I have around 50,000 or so word documents and I would like to write a script to so
rt these files by author. The author is
held as a extended file attribute and so far I have not been able to find a way to access th
is data. I have tried using the
following Win32::OLE script to extract these values. However under Windows 7 this does not r
eturn the correct information. I am
unsure wither this is because Windows 7 has changed the file attribute structure, or because
this method does not allow me access to
this data.
my $directory = $ARGV[0] || die "$pname requires directory as first ar
+gument\n";
find(\&main2, $directory);
sub main2{
if(-f $File::Find::name){
if(extention($File::Find::name) eq '.pdf'){
#print "File: $_ Extention: " . extention($_) . "\n";
my $shell = Win32::OLE-> new("Shell.Application") or die;
my $folder = $shell-> NameSpace("$File::Find::dir") or die;
my $file = $folder-> ParseName("$_") or die;
for my $i (0..50){
my $attrib = $folder-> GetDetailsOf($file, $i);
print "$i) $_ > > $attrib\n" if ! $attrib eq '';
}
print "-------------------------------------------\n";
}
}
}
<http://www.perlmonks.org/index.pl?abspart=1;displaytype=displaycode;node_id=804237;part=1>
[download]
I want to be able to access this value on pdf, doc & excel files types so if you could point
me in the direction of a module or
thread on how I can achieve this I would be forever grateful. Thanks and looking forward to
your response. Tim
--
Thanks,
Tim
Thread:
Tim Moor
Jan Dubois
|