Rumah  >  Soal Jawab  >  teks badan

如何在php中读取word的table和图片

如何在php中读取word的table和图片
$word = new COM("word.application") or die("Unable to instanciate Word");
$word->Visible = 0;//打开一个文档
$word->Documents->OPen("e:/word/11.doc");
//读取word的table和图片
-------------------------------------------------------------------------------------------------- 这块代码怎么写 --------------------------------------------------------------------------------------------------
//关闭 word
$word->Quit();

阿神阿神2922 hari yang lalu2636

membalas semua(2)saya akan balas

  • 学习ing

    学习ing2016-11-09 16:55:38

    Visible = 1; #打开一个新文档 
    $word->Documents->Add(); 
    #写 
    $word->Selection->TypeText("This is my a test....."); 
    #存 
    $word->Documents[1]->SaveAs("D:/tanfanlin.doc"); //打开文档
    $word->Documents->OPen("D:/tanfanlin.doc");
    echo $word->ActiveDocument->content->Text;
    //关闭 word
    $word->Quit();?> table 需要转换输出


    balas
    0
  • 汪汪

    汪汪2016-11-09 16:55:16

    header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); 
    header ("Last-Modified: " . gmdate("D,d M YH:i:s") . " GMT"); 
    header ("Cache-Control: no-cache, must-revalidate"); 
    header ("Pragma: no-cache"); 
    header('Content-type: application/rtf'); 
    header('Content-Disposition: attachment;filename=paper.rtf'); 
    header ("Content-Description: PHP/INTERBASE Generated Data" );

    balas
    0
  • Batalbalas