note 37700 modified in ref.com by danbrown
| From: | danbrown@php.net | Date: | Mon, 21 Dec 2009 17:13:12 +0000 |
| Subject: | note 37700 modified in ref.com by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-164219@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.
<?php
// 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';
}
?>
--was--
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';
}
http://php.net/manual/en/ref.com.php