473,765 Members | 2,034 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2358
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.********@com Acast.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",ifs tream::in);
while(officeFil e.good()){
doSomethingWith NextMSWordByte( officeFile.get( ));
}
officeFile.clos e();
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.********@com Acast.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",ifs tream::in);
while(officeFil e.good()){
doSomethingWith NextMSWordByte( officeFile.get( ));
}
officeFile.clos e();
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.publ ic.*' 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...@g mail.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

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

Similar topics

0
1058
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 links / ideas? Best regards / MfG,
0
908
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 this. I have a "Member" business object which contains information about an individual member. For instance, it contains the following properties: member.name = "SteveS" member.LoginName = "SteveS" member.Phone = '555-555-1234'
6
16027
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") xlSht = xlWb.WorkSheets(1) But sadly, I am unable to proceed further about how to read the cells of the
4
1686
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 2000. She is a high school student. English is not her first language. I find the "Lookup" facility in Word 2003 very useful. I think she woud
1
1708
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 vs.net 2005 express edition with office 97 I'm getting this error: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." when it comes to the second line of this code :
3
6249
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 that multiple worksheet data in different table.How can i do it.Below is my xml file. <?xml version="1.0"?> <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" ...
3
5402
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 that multiple worksheet data in different table.How can i do it.Below is my xml file. <?xml version="1.0"?> <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office"...
3
5962
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 the auto-updater from an .accde locally on my Windows Vista laptop, it works great. But when I run it on an XP terminal server I run into an error. The code is successfully deleting the old .accde and replacing it with a new one, but when it...
3
5000
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 external file in Excel 97 format. It was there yesterday, but it's gone today. Other formats are also gone. I have found the Value Pack on the original Office 97 Pro CD. It looks like I can install drivers directly from the value pack. There is an...
0
9568
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9399
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10163
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9835
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8832
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7379
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5276
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.