473,405 Members | 2,187 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,405 software developers and data experts.

How to read/execute word.exe from C++ project?

6
I need to read some word file from my c++ project through user interface.
I'm using dev C++ and FLTK GUI tool kit.
If any of you have an idea how to read/execute word file from c++ project, please let me know.
Or if you can recommend some tools/functions that can read the word file, it would also be helpful.
Thanks much in advance.
Nov 13 '07 #1
9 4309
weaknessforcats
9,208 Expert Mod 8TB
Are you talking about a .doc file from Microsoft Word?

If so, check the Office SDK. There's a bunch of stuff there.
Nov 13 '07 #2
lajet
6
Yes. I mean .doc file.
But how to call/execute from C++ coding?
Can you expalin in more detail?
Nov 14 '07 #3
oler1s
671 Expert 512MB
Your terminology is a bit wonky, so I have to question if you even know what you want. (Executing is the not the same as reading, and word.exe is not the same as a word document file.) You can't execute something that isn't...an executable. Which a doc file isn't.

With that said, I'll rephrase your question as how can I have my program open and read a word doc file?

The answer is, reverse engineer Microsoft's proprietary file format and reimplement it. That's why Microsoft can charge whatever huge price they charge for Word. Doc files are a proprietary format, so the only one who can guarantee properly opening those files is Microsoft and their own software. A few others have made importers/exporters for Word documents. They had a lot of resources and money and manpower to deal with the issue.

So if you get my point, effectively you cannot.
Nov 14 '07 #4
weaknessforcats
9,208 Expert Mod 8TB
True, but the Word SDK has a COM object that you can call from your C++ program - providing it's a Windows application.
Nov 14 '07 #5
lajet
6
Can you please write a short sample c++ code to call COM object?
Or where can i find the examples?
Thanks.
Nov 16 '07 #6
oler1s
671 Expert 512MB
Google is your friend.
Nov 16 '07 #7
Dear,
for run word.exe through visual C++ project type below code:

ShellExecute(GetSafeHwnd(),"open","Word.exe",NULL, NULL,1);

Be careful this function run programm that installed and be in Widows folder. if you run program or *.exe file that is not installed or in other folder you must determine destination. for example: "D:\\My folder\\Desktop\\Myprogram.exe", and last argument show window 1=normal and 3 = maximized.
best regards,
Nov 20 '07 #8
lajet
6
How about from borland c++?
Which command should i use for BC++?
I think there is no such command like shellexec in Visual c++.
Please advise me.
Thanks in advance.
Nov 30 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Tim Williams | last post by:
I'm trying to write a simple python program to access a MySQL database. I'm having a problem with using MySQLdb to get the results of a SQL command in a cursor. Sometimes the cursor.execute works,...
1
by: AP | last post by:
Hi, I'm trying to use c# to pop up a dialog box when a user attempts to close word to prompt them if they want to exit or cancel (obviously other stuff needs to happen based on their selection...
2
by: Mystery Man | last post by:
We are developing a C# application that has many interfaces to the Microsoft suite (eg Word, Excel, Outlook, Powerpoint, etc). We need to support Office 97, 2000, 2002 and any future versions. ...
2
by: Frank | last post by:
Hello, in a consoleapp I have a continious loop doing stuff. Additionally I want during the loop type in characters and when the combined chars form a word (ic 'test') I want to execute a method....
2
by: Paul | last post by:
Hi I am trying to build a tool that can read from a powerpoint file (slide text) and a microsoft project file (schedule information)and then write to a word file. Can something like this with vb.net...
1
by: winston.heng | last post by:
Hi, Thanks for reading this posting. I have been cracking my head on solving the infinite loop when i call the following section code. Any help or advise is greatly appreciated =D Thanks in...
5
by: sajithkahawatta | last post by:
i wrote a code to read a doc in asp.net i woked properly in my iis ms word is installed in this pc. but when i published in another sever in which there is no ms word instslled it give error in it...
0
by: carmen413 via VBMonster.com | last post by:
Dear All, my text file like following, a1, b1, c1, d1, e1 a2, b2, c2, d2, e2 a3, b3, c3, d3, e3 a4, b4, c4, d4, e4 .................
5
by: khalid Ahmed | last post by:
I'm attempting to execute a SQL SELECT query but it doesn't seem to be returning any records. I've confirmed that the connection is actually opening and when I tried to execute the same query on...
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
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...
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
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...
0
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,...
0
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...

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.