Link to home
Start Free TrialLog in
Avatar of BBB
BBB

asked on

how to control other windows applications??

basically i need to write a VC program which can control other windows applications.

for example, i would like this program to launch winword, and let it open a *.doc file, and then invoke its "save as" menu item to save the file as text format.

how would i automate this process in a VC program?
Avatar of vachooho
vachooho
Flag of United States of America image

open ClassWizard
click on  "newClass" button
select from type lib
file open dialog will be shown
select type librAry you need
(Excel8.olb forExcel 97, msacc8.olb for Access 97 etc.)
and add neccessary classes to your project
ClassWizwd will create wrapper class to automate objects you need

The exact sequence of calls needed for doing what you need can be found in Office VBA help.
Avatar of barbix
barbix

Hi.

Well there a good example for you question in :

http://support.microsoft.com/support/kb/articles/Q238/6/11.asp

Hope it will work :)

     Eran
barbix changed the proposed answer to a comment
ASKER CERTIFIED SOLUTION
Avatar of barbix
barbix

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BBB

ASKER

Hi there,
I appreciate all the clues...

But my question is more generic: I want to control other windows applications automatically in my program. I took winword as an example. So assume other windows application do not support OLE, etc kind of thing, how would I control these applications?

There are something called hook in windows. But I am not sure how to use them.

Thanks