in reply to Adding MSWord custom properties in Win32::OLE

When saving msword document after adjusting the custom properties you MUST set the Saved flag : see http://support.microsoft.com/kb/195425/en-us

without it it won't be saved.......

use strict; use Win32::OLE qw(in); use Win32::OLE::Const 'Microsoft Office'; #my ( $doc ) = Win32::OLE->GetObject('D:/4nt8/perl-msword_dap/excel_da +p/Inrichting Arag-ftp.doc'); my ( $doc ) = Win32::OLE->GetObject('//vldfps1/algemeen/FM&O/Klanten/S +-t/TESTING/Dap Dossier/01. Dap/FBL.OPR.UX.138 WI Inloggen, shutdown e +n reboot van LPAR AIX systemen m.b.v. de HMC en PTY.doc'); my $property = 'Arno'; my $value = 'KranenDONK'; my $docprops = $doc->CustomDocumentProperties(); unless (defined ($doc->CustomDocumentProperties($property))) { $docprops->Invoke('Add', { Name => $property, LinkToContent => 0, Type => 4, #msoPropertyTypeString #strictures to work around still Value => $value, }); } $doc->CustomDocumentProperties($property)->{Value} = $value; $doc->{Saved} = 0; # SEE : http://support.microsoft.com/kb/195425 en + http://compgroups.net/comp.lang.perl.misc/how-read-ms-word-summary-p +roperties/477092 $doc->Save; $doc-> Close;

Hope somebody will find this quicker then I did....