PHP 读取word的问题: 因为没有打开的文档,所以这一命令无效
代码是这样的:
$word = new COM("word.application") or die ("Could not initialise MS Word object.");
header("Content-Type:text/html; charset=GBK");
$word->Documents->Open(realpath($file_dir . $name));
$content = (string) $word->ActiveDocument->Content;
结果显示:
#Exception: <b>Source:</b> Microsoft Word<br/><b>Description:</b> 因为没有打开的文档,所以这一命令无效。
怎么解决??