Reading .docx in C++(用 C++ 读取 .docx)
问题描述
我正在尝试创建一个读取 .docx 文件并将其内容发布到博客/论坛供个人使用的程序.我终于想出了如何使用 libcurl 来做(我认为)是程序中最难的部分.现在我只需要阅读 .docx 文件,但遇到了麻烦.我似乎找不到有关如何执行此操作的任何文档.有什么想法吗?
I'm trying to create a program that reads a .docx file and posts it content to a blog/forum for personal use. I finally have figured out how to use libcurl to do (what I figured) was the harder part of the program. Now I just have to read the .docx file, but have come under a snag. I can't seem to find any documentation on how to do this. Any ideas?
推荐答案
最简单的方法是使用 Word 来执行此操作.它对许可有限制.
The easiest way is to use Word to do this. It has limitations on licensing.
SO 问题 创建、打开和打印 word 文件来自 C++ 有一些很好的参考.
The SO question Creating, opening and printing a word file from C++ has some good references.
根据这些问题/答案可以解压Open XML文件并直接处理XML文件:
According to these questions/answers can unzip the Open XML file and process the XML file directly:
- 如何读取 Word 2007 .docx 文件?
如果您使用 .NET,还有更多 (C#) 问题需要阅读:
If you use .NET there are more (C#) questions to read:
- 如何从 word 中抓取文本 (docx)C#中的文档?
- 如何在 C# (.NET) 中加载 MS Word 文档)?
- 我如何以编程方式使用C# 将多个 DOCX 文件附加在一起?
这篇关于用 C++ 读取 .docx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:用 C++ 读取 .docx
基础教程推荐
- 如何在 C++ 中正确使用命名空间? 2022-01-01
- 为什么我们不能使用“虚拟继承"?在 COM 中? 2022-01-01
- 与 CAS 的原子交换(使用 gcc 同步内置函数) 2022-01-01
- 如何更改 SysDateTimePick32 或 CDateTimeCtrl 的背景颜色? 2022-01-01
- 将不可复制的闭包对象传递给 std::function 参数 2021-01-01
- C++:获取传递给函数的多维数组的行大小 2021-01-01
- 随机插入/删除的综合向量与链表基准 2022-01-01
- 提升 ASIO 流缓冲 2021-01-01
- c++ STL设置差异 2022-01-01
- 如何部分禁用 cmake C/C++ 自定义编译器检查 2021-01-01
