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

Thanks. A little fettling gets the job done. Win32::OLE makes a whole lot of function calls look like empty hash references. But an empty hash ref is not undefined and can be tested for.
$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;
It looks a little weird in the debugger, as the fact that the value is set is hidden for a little while (value is ''). Suspect it's a debugger/tie/Windows interaction.

Thoglette.

--
Butlerian Jihad now!