如何使用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/