分类广告


推荐文章

  • 没有找到任何内容!
您当前的位置:中国站长下载网络编程PHP专区 → 文章内容

关于WORD文档的输出!

  • 作者:佚名    来源:不详    发布时间:2006-2-26 1:59:56
  • 字体大小:
就是写东东到*.doc中去



要用com八或用header



header
("Content-type:application/vnd.ms-word");



用com

<?

// create a reference to a new COM component (Word)

$word = new COM("word.application") or die("Can't start Word!");



// print the version of Word that's now in use

echo "Loading Word, v. {$word->Version}

";



// set the visibility of the application to 0 (false)

// to open the application in the forefront, use 1 (true)

$word->Visible = 0;



// create a new document in Word

$word->Documents->Add();



// add text to the new document

$word->Selection->TypeText("Testing 1-2-3...");



//save the document in the Windows temp directory

$word->Documents[1]->SaveAs("/Windows/temp/comtest.doc");



// close the connection to the COM component

$word->Quit();



// print another message to the screen

echo "Check for the file...";

?>
<