$property = "FooBar"; $doc->CustomDocumentProperties($property)->{Value} = $text_value;