在Excel XML中控制打印预览默认值

时间:2014-10-14 14:40:23

标签: xml excel

使用Excel XML和嵌入式样式表,您可以控制电子表格外观的许多方面。

有没有办法控制打印预览页面上的默认值?具体来说,我想将页面大小设置为1页1页。

1 个答案:

答案 0 :(得分:2)

在SpreadsheetML(Excel 2003 XML)中,FitToPage是WorksheetOptions元素中的一个元素。它还取决于Print元素中的元素FitWidth和FitHeight。

示例:

    <?xml version="1.0"?>
    <?mso-application progid="Excel.Sheet"?>
    <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
     xmlns:o="urn:schemas-microsoft-com:office:office"
     xmlns:x="urn:schemas-microsoft-com:office:excel"
     xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
     xmlns:html="http://www.w3.org/TR/REC-html40">
...
     <Worksheet ss:Name="Tabelle1">
      <Table>
       <Row>
        <Cell><Data ss:Type="Number">123</Data></Cell>
...
       </Row>
...
      </Table>
      <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
       <FitToPage/>
       <Print>
        <FitWidth>1</FitWidth>
        <FitHeight>1</FitHeight>
       </Print>
      </WorksheetOptions>
     </Worksheet>
    </Workbook>

问候

阿克塞尔

相关问题