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++ 中计算滚动/移动平均值 2021-01-01
- 如何检查GTK+3.0中的小部件类型? 2022-11-30
- C++结构和函数声明。为什么它不能编译? 2022-11-07
- 如何在 C++ 中初始化静态常量成员? 2022-01-01
- 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01
- 如何通过C程序打开命令提示符Cmd 2022-12-09
- 常量变量在标题中不起作用 2021-01-01
- 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01
- 这个宏可以转换成函数吗? 2022-01-01
- 我有静态或动态 boost 库吗? 2021-01-01