略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: COM

2025-02-27

COM 和 .Net(Windows)

添加备注

用户贡献的备注 1 note

up
7
acsandeep at gmail dot com
15 years ago
If you are trying to get the properties of a Word document opened via COM object, you may need to define some constants in your script like so.

<?php
define
('wdPropertyTitle', 1);
define('wdPropertySubject', 2);
define('wdPropertyAuthor', 3);
define('wdPropertyKeywords', 4);
define('wdPropertyComments', 5);
define('wdPropertyTemplate', 6);
define('wdPropertyLastAuthor', 7);

$word = new COM("word.application") or die ("Could not initialise MS Word object.");
$word->Documents->Open(realpath("Sample.doc"));
$Author = $word->ActiveDocument->BuiltInDocumentProperties(wdPropertyAuthor);

echo
$Author;
?>

官方地址:https://www.php.net/manual/en/book.com.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3