in reply to SetFileProperties

Where do these comments go I don't seem to see them anywhere? This is a great bit of code and it works for viewing doc props but not for setting them. I have tried and tried and played within my abilities. I have posted to discussions all over the show. I am trying to get any property to get written anyone help? I want to reset all our docs to the current company name and also recored and reset the last access and creation dates (that get changed when you edit something). Perl is the source. Any help appreciated

Replies are listed 'Best First'.
Re: Re: SetFileProperties
by poj (Abbot) on Jan 17, 2003 at 19:03 UTC
    This code worked for me
    use strict; use Win32::OLE; my $PR = Win32::OLE->new('DSOleFile.PropertyReader', 'Quit'); my $filename = "c:\\test.doc"; my $prop = $PR->GetDocumentProperties($filename) || die("Unable read file properties for '$filename' ", Win32:: +OLE->LastError()); $prop->SetProperty('title', 'My Title'); $prop->SetProperty('subject', 'My Subject'); $prop->SetProperty('author', 'My Author'); $prop->SetProperty('manager', 'My Manager'); $prop->SetProperty('company', 'My Company'); $prop->SetProperty('category', 'My Category'); $prop->SetProperty('keywords', 'My Keywords'); $prop->SetProperty('comments', 'My Comments');
    I couldn't find a way to change the created date though
    poj