微软Office和金山WPS的文档转换常用类型枚举
https://learn.microsoft.com/zh-cn/office/vba/api/word.wdsaveformat
| 名称 | 值 | Description |
|---|---|---|
| wdFormatDocument | 0 | Microsoft Office Word 97 - 2003 binary file format. |
| wdFormatDOSText | 4 | Microsoft DOS text format. |
| wdFormatDOSTextLineBreaks | 5 | Microsoft DOS text with line breaks preserved. |
| wdFormatEncodedText | 7 | Encoded text format. |
| wdFormatFilteredHTML | 10 | Filtered HTML format. |
| wdFormatFlatXML | 19 | Open XML file format saved as a single XML file. |
| wdFormatFlatXMLMacroEnabled | 20 | Open XML file format with macros enabled saved as a single XML file. |
| wdFormatFlatXMLTemplate | 21 | Open XML template format saved as a XML single file. |
| wdFormatFlatXMLTemplateMacroEnabled | 22 | Open XML template format with macros enabled saved as a single XML file. |
| wdFormatOpenDocumentText | 23 | OpenDocument Text format. |
| wdFormatHTML | 8 | Standard HTML format. |
| wdFormatRTF | 6 | Rich text format (RTF). |
| wdFormatStrictOpenXMLDocument | 24 | Strict Open XML document format. |
| wdFormatTemplate | 1 | Word template format. |
| wdFormatText | 2 | Microsoft Windows text format. |
| wdFormatTextLineBreaks | 3 | Windows text format with line breaks preserved. |
| wdFormatUnicodeText | 7 | Unicode text format. |
| wdFormatWebArchive | 9 | Web archive format. |
| wdFormatXML | 11 | Extensible Markup Language (XML) format. |
| wdFormatDocument97 | 0 | Microsoft Word 97 document format. |
| wdFormatDocumentDefault | 16 | Word default document file format. For Word, this is the DOCX format. |
| wdFormat PDF | 17 | PDF format. |
| wdFormatTemplate97 | 1 | Word 97 template format. |
| wdFormatXMLDocument | 12 | XML document format. |
| wdFormatXMLDocumentMacroEnabled | 13 | XML document format with macros enabled. |
| wdFormatXMLTemplate | 14 | XML template format. |
| wdFormatXMLTemplateMacroEnabled | 15 | XML template format with macros enabled. |
| wdFormatXPS | 18 | XPS format. |
https://learn.microsoft.com/zh-cn/office/vba/api/excel.xlfileformat
| 名称 | 值 | 说明 | 扩展名 |
|---|---|---|---|
| xlAddIn | 18 | Microsoft Excel 97-2003 外接程序 | *.xla |
| xlAddIn8 | 18 | Microsoft Excel 97-2003 外接程序 | *.xla |
| xlCSV | 6 | CSV | *.csv |
| xlCSVMac | 22 | Macintosh CSV | *.csv |
| xlCSVMSDOS | 24 | MSDOS CSV | *.csv |
| xlCSVUTF8 | 62 | UTF8 CSV | *.csv |
| xlCSVWindows | 23 | Windows CSV | *.csv |
| xlCurrentPlatformText | -4158 | 当前平台文本 | *.txt |
| xlDBF2 | 7 | Dbase 2 格式 | *.dbf |
| xlDBF3 | 8 | Dbase 3 格式 | *.dbf |
| xlDBF4 | 11 | Dbase 4 格式 | *.dbf |
| xlDIF | 9 | 数据交换格式 | *.dif |
| xlExcel12 | 50 | Excel 二进制工作簿 | *.xlsb |
| xlExcel2 | 16 | Excel 版本 2.0 (1987) | *.xls |
| xlExcel2FarEast | 27 | Excel 版本 2.0 Asia (1987) | *.xls |
| xlExcel3 | 29 | Excel 版本 3.0 (1990) | *.xls |
| xlExcel4 | 33 | Excel 版本 4.0 (1992) | *.xls |
| xlExcel4Workbook | 35 | Excel 版本 4.0 工作簿格式 (1992) | *.xlw |
| xlExcel5 | 39 | Excel 版本 5.0 (1994) | *.xls |
| xlExcel7 | 39 | Excel 95(版本 7.0) | *.xls |
| xlExcel8 | 56 | Excel 97-2003 工作簿 | *.xls |
| xlExcel9795 | 43 | Excel 版本 95 和 97 | *.xls |
| xlHtml | 44 | HTML 格式 | *.htm;*.html |
| xlIntlAddIn | 26 | 国际外接程序 | 无文件扩展名 |
| xlIntlMacro | 25 | 国际宏 | 无文件扩展名 |
| xlOpenDocumentSpreadsheet | 60 | OpenDocument 电子表格 | *.ods |
| xlOpenXMLAddIn | 55 | Open XML 外接程序 | *.xlam |
| xlOpenXMLStrictWorkbook | 61 (&H3D) | Strict Open XML 文件 | *.xlsx |
| xlOpenXMLTemplate | 54 | Open XML 模板 | *.xltx |
| xlOpenXMLTemplateMacroEnabled | 53 | 启用 Open XML 模板宏 | *.xltm |
| xlOpenXMLWorkbook | 51 | Open XML 工作簿 | *.xlsx |
| xlOpenXMLWorkbookMacroEnabled | 52 | 启用 Open XML 工作簿宏 | *.xlsm |
| xlSYLK | 2 | 符号链接格式 | *.slk |
| xlTemplate | 17 | Excel 模板格式 | *.xlt |
| xlTemplate8 | 17 | 模板 8 | *.xlt |
| xlTextMac | 19 | Macintosh 文本 | *.txt |
| xlTextMSDOS | 21 | MSDOS 文本 | *.txt |
| xlTextPrinter | 36 | 打印机文本 | *.prn |
| xlTextWindows | 20 | Windows 文本 | *.txt |
| xlUnicodeText | 42 | Unicode 文本 | 无文件扩展名;*.txt |
| xlWebArchive | 45 | Web 档案 | *.mh;*.mhtml |
| xlWJ2WD1 | 14 | 日语 1-2-3 | *.wj2 |
| xlWJ3 | 40 | 日语 1-2-3 | *.wj3 |
| xlWJ3FJ3 | 41 | 日语 1-2-3 格式 | *.wj3 |
| xlWK1 | 5 | Lotus 1-2-3 格式 | *.wk1 |
| xlWK1ALL | 31 | Lotus 1-2-3 格式 | *.wk1 |
| xlWK1FMT | 30 | Lotus 1-2-3 格式 | *.wk1 |
| xlWK3 | 15 | Lotus 1-2-3 格式 | *.wk3 |
| xlWK3FM3 | 32 | Lotus 1-2-3 格式 | *.wk3 |
| xlWK4 | 38 | Lotus 1-2-3 格式 | *.wk4 |
| xlWKS | 4 | Lotus 1-2-3 格式 | *.wks |
| xlWorkbookDefault | 51 | 默认工作簿 | *.xlsx |
| xlWorkbookNormal | -4143 | 常规工作簿 | *.xls |
| xlWorks2FarEast | 28 | Microsoft Works 2.0 亚洲格式 | *.wks |
| xlWQ1 | 34 | Quattro Pro 格式 | *.wq1 |
| xlXMLSpreadsheet | 46 | XML 电子表格 | *.xml |
另请参阅:Excel 支持的文件格式
https://learn.microsoft.com/zh-cn/office/vba/api/powerpoint.ppsaveasfiletype
| 常量 | 值 |
|---|---|
| ppSaveAsAddIn | 8 |
| ppSaveAsAnimatedGIF | 40 |
| ppSaveAsBMP | 19 |
| ppSaveAsDefault | 11 |
| ppSaveAsEMF | 23 |
| ppSaveAsExternalConverter | 64000 |
| ppSaveAsGIF | 16 |
| ppSaveAsJPG | 17 |
| ppSaveAsMetaFile | 15 |
| ppSaveAsMP4 | 39 |
| ppSaveAsOpenDocumentPresentation | 35 |
| ppSaveAsOpenXMLAddin | 30 |
| ppSaveAsOpenXMLPicturePresentation | 36 |
| ppSaveAsOpenXMLPresentation | 24 |
| ppSaveAsOpenXMLPresentationMacroEnabled | 25 |
| ppSaveAsOpenXMLShow | 28 |
| ppSaveAsOpenXMLShowMacroEnabled | 29 |
| ppSaveAsOpenXMLTemplate | 26 |
| ppSaveAsOpenXMLTemplateMacroEnabled | 27 |
| ppSaveAsOpenXMLTheme | 31 |
| ppSaveAs PDF | 32 |
| ppSaveAsPNG | 18 |
| ppSaveAsPresentation | 1 |
| ppSaveAsRTF | 6 |
| ppSaveAsShow | 7 |
| ppSaveAsStrictOpenXMLPresentation | 38 |
| ppSaveAsTemplate | 5 |
| ppSaveAsTIF | 21 |
| ppSaveAsWMV | 37 |
| ppSaveAsXMLPresentation | 34 |
| ppSaveAsXPS | 33 |
https://qn.cache.wpscdn.cn/encs/doc/office_v11/index.htm
| 名称 | 值 | 说明 |
|---|---|---|
| wdOpenFormatAllWord | 6 | 与 WPS 早期版本向后兼容的 WPS 格式。 |
| wdOpenFormatAuto | 0 | 现有格式。 |
| wdOpenFormatDocument | 1 | WPS 格式。 |
| wdOpenFormatEncodedText | 5 | 编码文本格式。 |
| wdOpenFormatRTF | 3 | RTF 格式。 |
| wdOpenFormatTemplate | 2 | 用作 WPS 模板。 |
| wdOpenFormatText | 4 | 未编码的文本格式。 |
| wdOpenFormatUnicodeText | 5 | Unicode 文本格式。 |
| wdOpenFormatWebPages | 7 | HTML 格式。 |
| wdOpenFormatXML | 8 | XML 格式。 |
| wdOpenFormatAllWordTemplates | 13 | WPS 模板格式。 |
| wdOpenFormatDocument97 | 1 | WPS 97 文档格式。 |
| wdOpenFormatTemplate97 | 2 | WPS 97 模板格式。 |
| wdOpenFormatXMLDocument | 9 | XML 文档格式。 |
| wdOpenFormatXMLDocumentMacroEnabled | 10 | 启用了宏的 XML 文档格式。 |
| wdOpenFormatXMLTemplate | 11 | XML 模板格式。 |
| wdOpenFormatXMLTemplateMacroEnabled | 12 | 启用了宏的 XML 模板格式。 |
说明: 通过切换v_11中的数字可以切换api版本,比如把11换成8就是v8版本,链接对应:https://qn.cache.wpscdn.cn/encs/doc/office_v8/index.htm
备注: 保存为wps格式选择编号1即可
https://qn.cache.wpscdn.cn/encs/doc/office_v11/index.htm
| 名称 | 值 | 说明 |
|---|---|---|
| xlAddIn | 18 | ET 2007 加载项 |
| xlAddIn8 | 18 | ET 97-2003 加载项 |
| xlCSV | 6 | CSV |
| xlCSVMac | 22 | Macintosh CSV |
| xlCSVMSDOS | 24 | MSDOS CSV |
| xlCSVWindows | 23 | Windows CSV |
| xlCurrentPlatformText | -4158 | 当前平台文本 |
| xlDBF2 | 7 | DBF2 |
| xlDBF3 | 8 | DBF3 |
| xlDBF4 | 11 | DBF4 |
| xlDIF | 9 | DIF |
| xlExcel12 | 50 | ET 12 |
| xlExcel2 | 16 | ET 2 |
| xlExcel2FarEast | 27 | Excel2 FarEast |
| xlExcel3 | 29 | Excel3 |
| xlExcel4 | 33 | Excel4 |
| xlExcel4Workbook | 35 | Excel4 工作簿 |
| xlExcel5 | 39 | Excel5 |
| xlExcel7 | 39 | Excel7 |
| xlExcel8 | 56 | Excel8 |
| xlExcel9795 | 43 | Excel9795 |
| xlHtml | 44 | HTML 格式 |
| xlIntlAddIn | 26 | 国际加载项 |
| xlIntlMacro | 25 | 国际宏 |
| xlOpenDocumentSpreadsheet | 60 | OpenDocument 电子表格 |
| xlOpenXMLAddIn | 55 | 打开 XML 加载项 |
| xlOpenXMLTemplate | 54 | 打开 XML 模板 |
| xlOpenXMLTemplateMacroEnabled | 53 | 打开启用的 XML 模板宏 |
| xlOpenXMLWorkbook | 51 | 打开 XML 工作簿 |
| xlOpenXMLWorkbookMacroEnabled | 52 | 打开启用的 XML 工作簿宏 |
| xlSYLK | 2 | SYLK |
| xlTemplate | 17 | 模板 |
| xlTemplate8 | 17 | 模板 8 |
| xlTextMac | 19 | Macintosh 文本 |
| xlTextMSDOS | 21 | MSDOS 文本 |
| xlTextPrinter | 36 | 打印机文本 |
| xlTextWindows | 20 | Windows 文本 |
| xlUnicodeText | 42 | Unicode 文本 |
| xlWebArchive | 45 | Web 档案 |
| xlWJ2WD1 | 14 | WJ2WD1 |
| xlWJ3 | 40 | WJ3 |
| xlWJ3FJ3 | 41 | WJ3FJ3 |
| xlWK1 | 5 | WK1 |
| xlWK1ALL | 31 | WK1ALL |
| xlWK1FMT | 30 | WK1FMT |
| xlWK3 | 15 | WK3 |
| xlWK3FM3 | 32 | WK3FM3 |
| xlWK4 | 38 | WK4 |
| xlWKS | 4 | 工作表 |
| xlWorkbookDefault | 51 | 默认工作簿 |
| xlWorkbookNormal | -4143 | 常规工作簿 |
| xlWorks2FarEast | 28 | Works2 FarEast |
| xlWQ1 | 34 | WQ1 |
| xlXMLSpreadsheet | 46 | XML 电子表格 |
备注: 保存为et格式选择编号18即可,但是会弹出兼容选择器弹窗,后期在考虑解决方案
https://qn.cache.wpscdn.cn/encs/doc/office_v11/index.htm
说明: 虽然可以找到文档,但是没找到对应枚举。

