$com = new \COM("word.application", null, CP_UTF8) or die("Can't start Word!");
$com->Visible = 0;
$com->Documents->OPen(request()->domain()."$wordname");
//$com->Documents[1]->SaveAs($toFileName,8);
$pa = new VARIANT(8, VT_I4); $com->Documents[1]->SaveAs($toFileName,$pa);
$com->Quit();
$com = null;
unset($com);
//文件编码转换
$contents_before = file_get_contents($toFileName);
$contents_after = iconv('gbk','utf-8',$contents_before);
file_put_contents($toFileName, $contents_after);