use strict; use Win32::OLE qw(in); use Win32::OLE::Const 'Microsoft Office'; my $Doc = Win32::OLE->GetObject('g:\scratch\test.doc'); if ( ( 0 + Win32::OLE::LastError() ) != 0 ) { $Doc->CustomDocumentProperties->Add( { Name => 'A custom property', LinkToContent => 0, Type => msoPropertyTypeString, Value => "Whatever" } ); }