如何使用C++读取word中的文档,并将内容放到excel文件中。automation接口帮助隐藏了word文本的格式细节,为我们提供了一个API,保证我们能够在程序中像访问普通的文本文档那样方便的访问word文档。
Well you can find several places where the MS Word DOC format is described. For example a Google for "MS Word File format" givesthis from MSDN.
Unfortunately the format is non-trivial and while extracting text may not be very difficult dealing with the format itself is quite difficult.BUT WAIT, there is an easier way! Let Word do the work for you! MS Word has an API ( COM I believe).
So while you could spend your time trying to learn all about the word file format, you could simply do some automation with word... but wait, if all you are doing is automation, why use C++ at all? Why not use a scripting language (VBS, VBS, Javascript, Python, Perl) which would probably be faster...
reference:
http://www.dreamincode.net/forums/topic/147209-microsoft-word-2003/
本文介绍了一种利用C++通过Automation接口来读取Word文档内容,并将其转换到Excel文件的方法。这种方式避免了直接解析复杂的Word文档格式,而是借助Word自身的API简化操作流程。
5901

被折叠的 条评论
为什么被折叠?



