leewy

如何将WEB页面中的数据保存为一个word文件

如何将WEB页面中的数据保存为一个word文件

protected void ConvertToHtml(string SrcFilePath,string TargetFilePath)
{
  Word.Application app=new Word.Application();
  app.Visible=false;
  Object o=Missing.Value;
  object docFile=SrcFilePath;
  _Document doc=app.Documents.Open(ref docFile,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o);
  object fileName=TargetFilePath;
  object format=Word.WdSaveFormat.wdFormatDocument; //word format
  doc.SaveAs(ref fileName,ref format,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o);
  object t=true;
  app.Quit(ref t,ref o,ref o);
}

分类:

技术点:

相关文章:

  • 2021-10-10
  • 2021-06-27
  • 2021-10-19
  • 2021-12-27
  • 2022-12-23
  • 2021-12-09
  • 2021-12-18
  • 2021-04-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
  • 2021-12-09
  • 2021-05-10
  • 2022-01-18
相关资源
相似解决方案