从C ++中读取Office文件。 [英] Read Office Files from C++.

查看:115
本文介绍了从C ++中读取Office文件。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我想使用ole32.dll

和C ++或C ++读取我的Office文件(DOC,XLS和PPT)文件.NEt。

我用google搜索了一下,发现我可以使用Stogare和Stream读取DOC

文件的内容,或者让我说ole32.dll。

但我不知道如何阅读嵌入式附件等其他内容。

实际上我想将DOC文件的所有嵌入式附件转储到我的

硬盘进行进一步处理。


所以任何人都可以帮我获取我需要的信息。

我无法找到任何教程或对ole32.dll的引用以及如何

用它从DOC文件中提取嵌入的附件。

请帮帮我,我将非常感激。

谢谢

miztaken

解决方案

miztaken写道:


我想读我的Office文件(DOC,XLS和PPT)文件使用ole32.dll

和C ++或C ++。NEt。

[..]

所以任何人都可以帮我获取我需要的信息。

[。 。]



您需要的是发布到正确的新闻组。请查找任何带有.ole的

新闻组。在它的名字中,最好还带有''microsoft''

它。您的问题与C ++ *语言*和

无关,与Microsoft组织文档文件的方式有关。


V
-

请在通过电子邮件回复时删除资金''A'

我没有回复最热门的回复,请不要不要问


Victor Bazarov< v。******** @ comAcast.netwrites:


miztaken写道:


>我想使用ole32.dll
和C ++读取我的Office文件(DOC,XLS和PPT)文件或者C ++。NEt。
[...]
所以任何人都可以帮我获取我需要的信息。
[...]



您需要的是发布到正确的新闻组。请查找任何带有.ole的

新闻组。在它的名字中,最好还带有''microsoft''

它。您的问题与C ++ *语言*和

无关,这与Microsoft组织其文档文件的方式有关。



嗯,clc ++还可以。

刚开始:


#include< fstream>


ifstream officeFile;

officeFile.open(" test.doc",ifstream :: in);

while(officeFile.good()){

doSomethingWithNextMSWordByte(officeFile.get());

}

officeFile.close();

然后我们可以讨论如何用C ++类表示一个

结构化文档等。


-

__Pascal Bourguignon__


Pascal J. Bourguignon写道:


Victor Bazarov< v。 ********@comAcast.netwrites:


> miztaken写道:


>>我想使用ole32.dll
和C ++或C ++读取我的Office文件(DOC,XLS和PPT).NEt。
[...]
所以任何人都可以请帮我拿到我需要的信息。
[..]

您需要的是发布到正确的新闻组。请查找任何带有.ole的
新闻组。在它的名字中,最好还带有''microsoft''。您的问题与C ++ *语言*无关,而且与Microsoft组织文档文件的方式有关。



嗯,clc ++还可以。

刚开始:


#include< fstream>


ifstream officeFile;

officeFile.open(" test.doc",ifstream :: in);

while(officeFile.good()){

doSomethingWithNextMSWordByte(officeFile.get());

}

officeFile.close();


然后我们可以讨论如何用C ++类表示一个

结构化文档等。



我相信OP正在尝试重用MS已经实现的用于读取他们自己文件的
。很可能有用于访问MS Office特定格式的部分的API。 (毫无疑问,如果格式布局已知并且可用,那么用纯C ++完成所有可能的工作是非常好的)


V

-

请在通过电子邮件回复时删除资金''A'

我没有回复最热门的回复,请不要'不要问


Hi there,
I want to read my Office Files (DOC,XLS and PPT) files using ole32.dll
and C++ or C++.NEt.
I have googled a bit and found that i can read the contents of DOC
file by using Stogare and Stream, or let me say ole32.dll.
But i dont know how to read other things like embedded attachments.
Actually i want to dump all the embedded attachments of DOC file to my
hard drive for further processing.

So can any one please help me get the info i need.
I am unable to find any tutorial or references to ole32.dll and how to
use it to extract embedded attachments from DOC file.
Please help me, i would be very much grateful.
Thank you
miztaken

解决方案

miztaken wrote:

I want to read my Office Files (DOC,XLS and PPT) files using ole32.dll
and C++ or C++.NEt.
[..]
So can any one please help me get the info i need.
[..]

What you need is to post to the right newsgroup. Please look for any
newsgroup with .ole. in its name, preferably also with ''microsoft'' in
it. Your problem has really nothing to do with the C++ *language* and
everything to do with the way Microsoft organizes its document files.

V
--
Please remove capital ''A''s when replying by e-mail
I do not respond to top-posted replies, please don''t ask


Victor Bazarov <v.********@comAcast.netwrites:

miztaken wrote:

>I want to read my Office Files (DOC,XLS and PPT) files using ole32.dll
and C++ or C++.NEt.
[..]
So can any one please help me get the info i need.
[..]


What you need is to post to the right newsgroup. Please look for any
newsgroup with .ole. in its name, preferably also with ''microsoft'' in
it. Your problem has really nothing to do with the C++ *language* and
everything to do with the way Microsoft organizes its document files.

Well, clc++ is ok.
Just start with:

#include <fstream>

ifstream officeFile;
officeFile.open("test.doc",ifstream::in);
while(officeFile.good()){
doSomethingWithNextMSWordByte(officeFile.get());
}
officeFile.close();
Then we could discuss how we could represent with C++ classes a
structured document, etc..

--
__Pascal Bourguignon__


Pascal J. Bourguignon wrote:

Victor Bazarov <v.********@comAcast.netwrites:

>miztaken wrote:

>>I want to read my Office Files (DOC,XLS and PPT) files using ole32.dll
and C++ or C++.NEt.
[..]
So can any one please help me get the info i need.
[..]

What you need is to post to the right newsgroup. Please look for any
newsgroup with .ole. in its name, preferably also with ''microsoft'' in
it. Your problem has really nothing to do with the C++ *language* and
everything to do with the way Microsoft organizes its document files.


Well, clc++ is ok.
Just start with:

#include <fstream>

ifstream officeFile;
officeFile.open("test.doc",ifstream::in);
while(officeFile.good()){
doSomethingWithNextMSWordByte(officeFile.get());
}
officeFile.close();
Then we could discuss how we could represent with C++ classes a
structured document, etc..

I believe the OP was trying to reuse what MS has already implemented for
reading their own files. Most likely there are APIs for accessing parts
of the MS Office-specific formats. (not to doubt that it''s all possible
to do in plain C++ if the format layout is known and available)

V
--
Please remove capital ''A''s when replying by e-mail
I do not respond to top-posted replies, please don''t ask


这篇关于从C ++中读取Office文件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆