乔山办公网我们一直在努力
您的位置:乔山办公网 > word文档 > 怎样将<em>word</em>文件保存为HTML格式-word html样式,html转wor

怎样将<em>word</em>文件保存为HTML格式-word html样式,html转wor

作者:乔山办公网日期:

返回目录:word文档


你用IE浏览器打开你的HTML文件,然后点击菜单栏 文件→使用 Microsoft Office Word 编辑,之后系统会自动打开 Word 并显示HTML文件的内容,这是保存即可。

如果找不到“使用 Microsoft Office Word 编辑”的话,点击菜单栏 工具→Internet 选项→程序→ HTML 编辑器 → Microsoft Office Word → 确定。

将word文件保存为HTML格式的方法:

1、打开需要保存为html的word文档

2、点击左上角的另存为:

3、在弹出的保存窗口中,选择保存类型为html,确定:

4、保存成功。


http://wenku.baidu.com/link?url=vnoxWaruXsk1SyFLvIBkmrtjoI3S6o7mCSGLMO0V_XGBtHpq3XubKfs61uzYRyYEhuiV4pP7_k81Dnab3J0O4kByfpiQHv-RLZeXYTzhPFq
你去看看这篇,这篇讲的比较细

@RequestMapping("download")
public void exportWord( HttpServletRequest request, HttpServletResponse response)
throws Exception {
User user = AppContext.getLoginUser();
Student student = studentSvc.findByUserId(user.getId());
try {
//word内容
String content="<html><body></body></html>";
byte b[] = content.getBytes("utf-8"); //这里是必须要设置编码的,不然导出中e799bee5baa6e58685e5aeb9331文就会乱码。
ByteArrayInputStream bais = new ByteArrayInputStream(b);//将字节数组包装到流中
/*
* 关键地方
* 生成word格式
*/
POIFSFileSystem poifs = new POIFSFileSystem();
DirectoryEntry directory = poifs.getRoot();
DocumentEntry documentEntry = directory.createDocument("WordDocument", bais);
//输出文件
String fileName="实习考核鉴定表";
request.setCharacterEncoding("utf-8");
response.setContentType("application/msword");//导出word格式
response.addHeader("Content-Disposition", "attachment;filename=" +
new String( (fileName + ".doc").getBytes(),
"iso-8859-1"));

OutputStream ostream = response.getOutputStream();
poifs.writeFilesystem(ostream);
bais.close();
ostream.close();
}catch(Exception e){
AppUtils.logError("导出出错:%s", e.getMessage());
}
}

相关阅读

关键词不能为空
极力推荐
  • 如何将文本文档转换为word文档-word简繁转换

  • word简繁转换,首先,我们右击电脑桌面空白处,弹出的界面,我们将鼠标放在新建处;2.弹出的界面,我们点击文本文档;3.弹出的界面,我们点击空白处;4.之后我们右击文本文档,弹出

ppt怎么做_excel表格制作_office365_word文档_365办公网