note 37700 added to ref.com
| From: | php-general at lists dot php dot net | Date: | Sun, 23 Nov 2003 14:57:34 +0000 |
| Subject: | note 37700 added to ref.com | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-60877@lists.php.net to get a copy of this message | ||
Here is an example of reading the custom properties like Author, Keywords, etc. which are stored in
MS Office and other Windows files. You must install and register dsofile as described at http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q224351.
The .frm file in that distribution lists most of the available properties.
// the file you wish to access
$fn = '/docs/MFA.xls';
$oFilePropReader = new COM('DSOleFile.PropertyReader');
$props = $oFilePropReader->GetDocumentProperties($fn);
// one syntax
$au = com_get($props, 'Author');
print "au: $au \n";
//another syntax
$str = 'LastEditedBy';
$lsb = $props->$str;
var_dump($lsb);
// set a property if you wish
if (!$props->IsReadOnly()) {
$props->Subject = 'tlc';
}
----
Manual Page -- http://www.php.net/manual/en/ref.com.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+37700
Delete -- http://master.php.net/manage/user-notes.php?action=delete+37700&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+37700&report=yes
Search -- http://master.php.net/manage/user-notes.php