代码之家  ›  专栏  ›  技术社区  ›  Jared

通过HTML生成Word文档时强制普通视图

  •  1
  • Jared  · 技术社区  · 16 年前

    application/msword 内容类型。到目前为止,除了在Word和Web视图中打开文件外,其他方法都有效。一旦选择了正常视图,所有工作正常。有没有办法强迫Word以普通视图而不是Web视图打开?

    1 回复  |  直到 13 年前
        1
  •  1
  •   D'Arcy Rittich    16 年前

    下面是一个最简单的例子。另存为 test.htm ,单击鼠标右键,然后用Word打开:

    <html xmlns:v="urn:schemas-microsoft-com:vml" 
        xmlns:o="urn:schemas-microsoft-com:office:office" 
        xmlns:w="urn:schemas-microsoft-com:office:word" 
        xmlns="http://www.w3.org/TR/REC-html40"> 
        <head> 
            <title>Test doc</title> 
            <!--[if gte mso 9]><xml> 
             <w:WordDocument> 
              <w:View>Normal</w:View> 
              <w:Zoom>100</w:Zoom> 
             </w:WordDocument> 
            </xml><![endif]--> 
        </head> 
        <body> 
        To Whom It May Concern, 
        </body> 
    </html> 
    
    推荐文章