AKB Forums

Go Back   AKB Forums > Technical sections > Languages, Compilers and Interpreters > C/C++
Home Register Blogs FAQ Members List Calendar Downloads Arcade Mark Forums Read

Troubles when posting message? Click here! :: Ïðîáëåìû ñ îòïðàâëåíèåì ñîîáùåíèÿ? Íàæìèòå ñþäà!

Reply
 
LinkBack Thread Tools Display Modes
Old Aug 17, 2006, 12:16   #1
Ìëàäåíåö
 
Join Date: Aug 2006
Location: Currently in Germany.
Posts: 2
Rep Power: 0
Reputation: 10
How to steer the Word documents in already opened Word application.

Hi,

I have the following question. I’m writing the program in C++, which is
opening in background the Word document, modifying and then closing it. Till
now each document has been opened with separate Word application and after
modification has been closed:
CApplication objWord;
if(!objWord.CreateDispatch("Word.Application"))
.....
CDocuments docs(objWord.get_Documents());
doc.AttachDispatch(docs.Open(....));
.....
docs.Close(covFalse,covOptional,covOptional);
objWord.Quit(covFalse,covTrue,covFalse);

Now I want to open Word application only once, and then in consecutive order
open, manipulate and close the documents.

Of course I can check whether “winword.exe” process existing or not and also
read the PID, but how can I steer the document?
khash_de is offline   Reply With Quote Quote selected
Old Aug 17, 2006, 17:08   #2
Ìëàäåíåö
 
Join Date: Aug 2006
Location: Currently in Germany.
Posts: 2
Rep Power: 0
Reputation: 10
How can I get access to the already opened Word application?

Dear Colleagues,

I found that my question was not presented very clear. I'll try to explain it better.

Firs of all I should mention that I’m faraway from COM and OLE programming, but now I'm working on one project and I guess I need to learn that.

The problem is following. I have a Windows service, which is working according to some algorithm. From time to time it creates the process, runs the MS Word application, opens the Word document, manipulates it and then closes the document and Word application.



Now I should increase the speed of this process. I have found that starting the Word application consumed most of the time. Therefore I have decided to open the Word application only once and then, when it is necessary, open and manipulate the Word documents.

The only information I have is PID (PROCESS_INFORMATION) of the process, created by CreateProcess.

My question is following.

How can I get access to the already opened Word application, open there the Word document and manipulate it.

Thank you in advance,

Suren Karabekyan
khash_de is offline   Reply With Quote Quote selected
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Download Free Ebooks (Computers, Physics, Math and more) acid TWARM 219 Jul 16, 2008 07:04
WORLD PRESS PHOTO 2004 EXHIBITION OPENED IN YEREVAN PsilocybeLarvae News 8 Mar 7, 2005 14:20
CEU Summer University Program Description PsilocybeLarvae Science and Education 0 Jan 11, 2005 12:41
Tray Helper - application you need ;-D and plugin by ACiD soft irekz Languages, Compilers and Interpreters 0 Jun 5, 2002 05:05
Application To Date My Daughter PsilocybeLarvae Fun 0 May 7, 2002 23:03


All times are GMT. The time now is 10:23.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
This board was founded on September 29, 2001
Powered by Viper Internet

Affordable Web Hosting | ParevNet

Buy text link