开发者社区 问答 正文

php打开word文档提示"因为没有打开的文档,所以这一命令无效" :报错

<?php
$word = new COM("word.application") or die ("Could not initialise MS Word object.");

$word->ActiveDocument->Open("d:\\temp\\1.doc");

// Extract content.

$content = (string) $word->ActiveDocument->Content;

echo $content;


用word就可以打开 ,这是什么原因


展开
收起
kun坤 2020-06-20 13:47:05 41663 分享 版权
1 条回答
写回答
取消 提交回答
  • http://stackoverflow.com/questions/12104775/cant-open-word-doc-with-com-in-php

    http://stackoverflow.com/questions/4659936/using-office-word-to-read-doc-files-with-php

    2020-06-20 13:47:11
    赞同 展开评论
问答分类:
PHP
问答地址: