SectionMode

XlsxSaveOptions.SectionMode property

获取或设置保存到输出 XLSX 文档时处理各部分的方式。 默认值为MultipleWorksheets.

public XlsxSectionMode SectionMode { get; set; }

例子

展示如何将文档保存为单独的工作表。

Document doc = new Document(MyDir + "Big document.docx");

// 文档的每个部分都将创建为单独的工作表。
// 使用“SingleWorksheet”在一个工作表上显示所有文档。
XlsxSaveOptions xlsxSaveOptions = new XlsxSaveOptions();
xlsxSaveOptions.SectionMode = XlsxSectionMode.MultipleWorksheets;

doc.Save(ArtifactsDir + "XlsxSaveOptions.SelectionMode.xlsx", xlsxSaveOptions);

也可以看看