473,386 Members | 2,129 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Read Office Files from C++.

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
Jun 27 '08 #1
12 2329
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
Jun 27 '08 #2
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__
Jun 27 '08 #3
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
Jun 27 '08 #4
So how do i start..?
If any one can provide me the structure definition of DOC file (office
file).
I am able to get content of DOC file using IStream and IStorage
objects of ole32.dll.
But when parsing there are different object types and i dont know
their offsets.
So can anyone guide me on this?

You help is greatly appreciated.

Thank You
Jun 27 '08 #5
miztaken wrote:
So how do i start..?
You start by finding *a better venue* for this line of questions.
If any one can provide me the structure definition of DOC file (office
file).
MS Office has no relation to C++ *language*. Any third-party technology
discussion is basically off-topic here. Even if somebody knows the
structure of a DOC (or any other MS Office-specific) file, proceeding
with providing it here would go against the rules of this newsgroup.
I am able to get content of DOC file using IStream and IStorage
objects of ole32.dll.
But when parsing there are different object types and i dont know
their offsets.
So can anyone guide me on this?
OK, I'll repeat myself. Yes, somebody in the newsgroup relevant to
programming MS Office applications should be able to. Take a close look
at the 'microsoft.public.*' hierarchy.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jun 27 '08 #6
actually i have posted there as well and the group seem to have very
less activity as it may occur to me.
Thanks anyways for your suggestion.
Jun 27 '08 #7
miztaken wrote:
actually i have posted there as well and the group seem to have very
less activity as it may occur to me.
<rantish>
What if you need a recipe for a peach cobbler and the place where you
think you should be able to find it, is deserted (pun intended)? Do you
come to the electricians' newsgroup to see if anyone who has some
experience installing electrical ovens can help you?

Here is a story for you:

One cloudy night there was this man, standing on all four, feeling the
pavement with his hands, apparently looking for something on the ground
under a bright street light. Another man stops and asks, have you lost
something? Oh... My car key, I just dropped it, says the first man. So
the other man joins in and also starts looking around, trying to locate
the key. After a couple of minutes the second man asks the first one,
where exactly were you standing when you dropped the key? Over there,
says the first man and waves his arm towards the gates at the dark end
of the street about a hundred feet away. Then why are you looking here,
for crying out loud? Well, *here* I can actually *see*!
</rantish>

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jun 27 '08 #8
ok..
here is the things

1. Before i knew this wasnt the group for my question, i already had
posted my question and after that i posted on few more as well.
So where does those electrical oven fit here.

2. and about the light thing.
Since we can use ole32.dll through C++ this makes totally sensible for
me to hope if someone has done this before and if they have used it
then its not related to Office files any more but related to compound
files.

What do u think ?
Jun 27 '08 #9
On May 20, 6:15 am, miztaken <justjunkt...@gmail.comwrote:
ok..
here is the things

1. Before i knew this wasnt the group for my question, i already had
posted my question and after that i posted on few more as well.
So where does those electrical oven fit here.

2. and about the light thing.
Since we can use ole32.dll through C++ this makes totally sensible for
me to hope if someone has done this before and if they have used it
then its not related to Office files any more but related to compound
files.

What do u think ?
Miztaken Mon Ami dont bark at Moderators, they bite back. ;) (No
offence Victor)
You can debate on the relevance of your post as much as you want.
But it wont help you, as Victor said this is C++ *language* group.
(half of the people here dont even know what is office :) )
Feel free to post Qs about the standard, Design issues, UB & etc...
even though it seems it's a "narrow region of intrest" the group's
hands are always full.

try:
comp . os . ms-windows . programmer . win32
http://groups.google.com/group/comp....2/topics?hl=en
search codeproject.com or even msdn (my favourite for this kind of Qs
is vintage 10/01 and not the recents)
or try e-mailing that nice Stefan Ram.

in conclusion: if you keep with this post you will get a inadequate
answers and a lot of ranting.
Jun 27 '08 #10
Hi!

Pascal J. Bourguignon schrieb:
Just start with:

#include <fstream>

ifstream officeFile;
officeFile.open("test.doc",ifstream::in);
while(officeFile.good()){
doSomethingWithNextMSWordByte(officeFile.get());
}
officeFile.close();
Which is actually a bad example, because .good() will not indicate that
..get() will succeed on the next call. But if
doSomethingWithNextMSWordByte can cope with the EOF value, everything is
fine, I think.

Regards, Frank
Jun 27 '08 #11
Hi ManicQin,
Thanks for the info.

Jun 27 '08 #12
miztaken wrote:
So how do i start..?
If any one can provide me the structure definition of DOC file (office
file).
I am able to get content of DOC file using IStream and IStorage
objects of ole32.dll.
But when parsing there are different object types and i dont know
their offsets.
So can anyone guide me on this?
This is OT here, and you should be directed to microsoft.* but I will give a
pointer because in microsoft.* you will be directed to microsoft specific
solutions.

Look at openoffice. It's opensource, freely downloadable, will open office
documents (.doc, .xls, etc..) I'm not sure if they tie into ole or not, but
you can check them out. If you don't get an answer there,
microsoft.public.vc.language would be the way to go for the microsoft
specific answers.
You help is greatly appreciated.

Thank You


--
Jim Langston
ta*******@rocketmail.com
Jun 27 '08 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Joerg Battermann | last post by:
Hello there :) I was wondering whether there are any libraries available for c# that make reading and indexing office files possible, without having office installed (like POI for java) any...
0
by: SteveS | last post by:
I'm not sure if this is the right forum, but here it goes :-) This has been bothering me for a long time, and I'm curious about everyone's opinion or a "Microsoft Best Practices" method of doing...
6
by: Anand | last post by:
Hello, Can I get some help on how to read the excel files using python? from win32com.client import Dispatch xlApp = Dispatch("Excel.Application") xlWb = xlApp.Workbooks.Open("Read.xls")...
4
by: Lyle Fairfield | last post by:
I asked this question in Microsoft.Public.Word two days ago but I have not received an answer. I believe there are Office Experts here who may be able to help. --------- "A friend has Office...
1
by: =?Utf-8?B?QmFkaXM=?= | last post by:
Hi, I'm using automation to produce word documents, and it's working fine in my machine that have vs.net 2005 and office xp in it. BUT when I move my application to another machine that have...
3
by: sejal17 | last post by:
hello Can any one tell me how to read multiple worksheets from a single excel file.I have stored that excel in xml file.so i want to read that xml that has multiple worksheet.And i want to store...
3
by: sejal17 | last post by:
hello Can any one tell me how to read multiple worksheets from a single excel file.I have stored that excel in xml file.so i want to read that xml that has multiple worksheet.And i want to store...
3
by: evenlater | last post by:
I've implemented Bob Larson's frontend auto-updater which runs a batch file that deletes an existing copy of my .accde and then replaces it with a copy of the most recent .accde file. When I run...
3
by: Chuck | last post by:
I've been having problems with Access and Excel talking to one another. In the process of trying to add features (programs) to Access 97 I have lost the ability to export an Access query to an...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.