473,804 Members | 2,190 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

6 New Member
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 4340
weaknessforcats
9,208 Recognized Expert Moderator Expert
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 New Member
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 Recognized Expert Contributor
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 Recognized Expert Moderator Expert
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 New Member
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 Recognized Expert Contributor
Google is your friend.
Nov 16 '07 #7
mostafa110
6 New Member
Dear,
for run word.exe through visual C++ project type below code:

ShellExecute(Ge tSafeHwnd(),"op en","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 New Member
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
weaknessforcats
9,208 Recognized Expert Moderator Expert
Read http://msdn2.microsoft.com/en-us/library/bb762153.aspx.
Nov 30 '07 #10

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

Similar topics

2
5057
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, sometimes not. From mysql: mysql> show databases; +-----------+ | Database |
1
8347
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 but that's the gist of it.) I have everything set up, and it seems to work except that setting Cancel to true and returning from my c# method appears to do nothing. Word still closes. Am I doing something wrong? private void...
2
6643
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. Our first cut used early binding and worked fine with Office 2002. We then ran on a machine that had Office 2000 installed and it all turned to custard. There appears to be a number of options to take to support multiple versions:
2
2323
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. What could I use? Not Console.Read because it blocks the main loop. I would need a asynchronous read of some kind. Anyone have a simple solution? Thanks Frank
2
6523
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 also are there any examples that might show some of the methods and classes used thanks Paul.
1
8771
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 advance. Cheers!
5
4330
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 i used com reference. i want to know is there is a way to read a doc when ms word is not instslled on the server
0
8432
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
2180
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 mysqL server it returns results. but when I execute the query in my project without using OdbcParameter, it returns the result as expected. Here is my code... // connection string declaration string connstr = @"Driver={MySQL...
0
9714
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...
1
10351
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10096
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
9174
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
7638
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
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4311
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3834
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3002
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.