没有找到合适的产品?
联系客服协助选型:023-68661681
提供3000多款全球软件/控件产品
针对软件研发的各个阶段提供专业培训与技术咨询
根据客户需求提供定制化的软件开发服务
全球知名设计软件,显著提升设计质量
打造以经营为中心,实现生产过程透明化管理
帮助企业合理产能分配,提高资源利用率
快速打造数字化生产线,实现全流程追溯
生产过程精准追溯,满足企业合规要求
以六西格玛为理论基础,实现产品质量全数字化管理
通过大屏电子看板,实现车间透明化管理
对设备进行全生命周期管理,提高设备综合利用率
实现设备数据的实时采集与监控
利用数字化技术提升油气勘探的效率和成功率
钻井计划优化、实时监控和风险评估
提供业务洞察与决策支持实现数据驱动决策
翻译|使用教程|编辑:李显亮|2021-06-29 11:05:38.640|阅读 258 次
概述:在本文中,将学习如何将 DOCX 文件转换为 DOC 格式以及如何将 DOC 文件转换为 DOCX 格式。
# 界面/图表报表/文档/IDE等千款热门软控件火热销售中 >>
Microsoft Word 文档有两种格式, DOC 和 DOCX。DOC 是一种较旧的格式,而 DOCX 是它的继任者。可以将 DOCX 文件转换为 DOC 格式,反之亦然。在本文中,将学习如何将 DOCX 文件转换为 DOC 格式以及如何将 DOC 文件转换为 DOCX 格式。
让我们探索以下有关的内容:
Aspose.Words for C++ 是一个原生的 C++ 库,允许您创建、读取和修改 Microsoft Word 文档。此外,它还支持将 DOCX 文件转换为 DOC 格式和将 DOC 文件转换为 DOCX 格式。
>>你可以点击这里下载Aspose.Words for C ++ 最新版测试体验。
可以按照以下步骤将 DOCX 文件转换为 DOC 格式。
以下示例代码显示了如何使用 C++ 将 DOCX 文件转换为 DOC 文件。
// Create an instance of the LoadOptions class auto loadOptions = System::MakeObject(); // Specify LoadFormat of input word document loadOptions->set_LoadFormat(LoadFormat::Docx); // Load source DOCX file System::SharedPtrdoc = System::MakeObject(u"SourceDirectory\\Word\\Sample 4.docx", loadOptions); // Save the DOC file doc->Save(u"OutputDirectory\\output.doc", SaveFormat::Doc);
如果有数百个 DOCX 文件需要转换为 DOC 格式,则只需执行一次程序即可轻松转换它们。在这个例子中,我们将使用 boost 库来遍历目录中的文件。以下是将DOCX文件批量转换为DOC格式的步骤。
以下示例代码演示了如何使用 C++ 将 DOCX 文件批量转换为 DOC 格式。
// Iterate through the files in the directory for (directory_entry& file : directory_iterator("SourceDirectory\\Word")) { // Check file extension if (file.path().extension().string() == ".docx") { // Create an instance of the LoadOptions class auto loadOptions = System::MakeObject(); // Specify LoadFormat of input word document loadOptions->set_LoadFormat(LoadFormat::Docx); // Load the DOCX file System::SharedPtrdoc = System::MakeObject((System::String)file.path().string(), loadOptions); // Change the file extension System::String fileName = (System::String)file.path().filename().string(); fileName = fileName.Replace(u".docx", u".doc"); // Save the DOC file doc->Save(System::String::Concat(u"OutputDirectory\\", fileName), SaveFormat::Doc); } }
以下是将 DOC 文件转换为 DOCX 文件的步骤。
以下示例代码显示了如何使用 C++ 将 DOC 文件转换为 DOCX 文件。
// Create an instance of the LoadOptions class auto loadOptions = System::MakeObject(); // Specify LoadFormat of input word document loadOptions->set_LoadFormat(LoadFormat::Doc); // Load source DOC file System::SharedPtrdoc = System::MakeObject(u"SourceDirectory\\Word\\Sample 1.doc", loadOptions); // Save the DOCX file doc->Save(u"OutputDirectory\\output.docx", SaveFormat::Docx);
要将 DOC 文件批量转换为 DOCX 格式,请使用以下步骤。
以下示例代码演示了如何使用 C++ 将 DOC 文件批量转换为 DOCX 格式。
// Iterate through the files in the directory for (directory_entry& file : directory_iterator("SourceDirectory\\Word")) { // Check file extension if (file.path().extension().string() == ".doc") { // Create an instance of the LoadOptions class auto loadOptions = System::MakeObject(); // Specify LoadFormat of input word document loadOptions->set_LoadFormat(LoadFormat::Doc); // Load the DOC file System::SharedPtrdoc = System::MakeObject((System::String)file.path().string(), loadOptions); // Change the file extension System::String fileName = (System::String)file.path().filename().string(); fileName = fileName.Replace(u".doc", u".docx"); // Save the DOCX file doc->Save(System::String::Concat(u"OutputDirectory\\", fileName), SaveFormat::Docx); } }
如果你想试用Aspose的全部完整功能,可联系在线客服获取30天临时授权体验。
本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@wqylolg.cn
DHTMLX 产品支持构建功能丰富的预订系统,从而简化针对不同行业的预约安排。Scheduler 组件丰富的功能(可自定义的日历视图、重复事件等)与 Booking 小部件现成的预订管理 UI 相结合,满足您构建现代化 Web 预订解决方案所需。
在 Excel 中删除重复行对于维护干净、准确和一致的数据集至关重要。在本篇博文中,我们将向您展示如何使用 Python 以编程方式删除 Excel 工作表中的重复行。
无论是零售、物流还是医疗保健,旋转条形码图像的功能都能增强不同应用的灵活性和适应性。使用Aspose.BarCode for Java,您可以轻松旋转条形码图像,确保它们无缝融入应用程序的设计和布局。
借助Aspose.Slides for Java,开发人员可以轻松编辑 PowerPoint 幻灯片(包括表格),以增强演示文稿的效果。
不依赖Microsoft Word,可在任何C++应用程序中生成和操作Word格式文档。
服务电话
重庆/ 023-68661681
华东/ 13452821722
华南/ 18100878085
华北/ 17347785263
客户支持
技术支持咨询服务
服务热线:400-700-1020
邮箱:sales@wqylolg.cn
关注我们
地址 : 重庆市九龙坡区火炬大道69号6幢