BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Deleting / Destroyinh MS-Word OLE

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (ActiveX)
View previous topic :: View next topic  
Author Message
Omer Eisenberg
Guest





PostPosted: Wed Jun 16, 2004 8:28 am    Post subject: Deleting / Destroyinh MS-Word OLE Reply with quote




Hi All,
I'm creating an OLE interface from my program, but can't get read of the WINWORD process.
I'm using the following to create the object:
Variant msWord = OleCreateObject ("Word.Application");
That works just fine. Trouble is, when I'm done, the process remains alive. I've tried
msWord = Unassign;
but it won't work. The process is still there.
Thanks in advance,
Omer.

Back to top
Jean-Marie Babet
Guest





PostPosted: Wed Jun 16, 2004 5:16 pm    Post subject: Re: Deleting / Destroyinh MS-Word OLE Reply with quote



Hello Omer,

It's been a while since I've automated "Word" for anything significant but
from what I recall, you typically need to invoke the "Quit" method and then
clear the Variant.

The following link illustrates the idea:

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=c7co1j%24oau%241%40host.talk.ru

IOW -


void __fastcall TForm1::Button1Click(TObject *Sender)
{
Variant Word, Document, Table, Cell;

Word = CreateOleObject("Word.Application.8");
Word.OlePropertySet("Visible", true);

... [Here you do something] ...

Word.OleProcedure("Quit");
}


Regards,


Bruneau.

PS: In the case above the Variant is not explicitly released/cleared since
it's a local variable who's destructor will be invoked when the function is
left.


"Omer Eisenberg" <omereis (AT) yahoo (DOT) com> wrote

Quote:

Hi All,
I'm creating an OLE interface from my program, but can't get read of the
WINWORD process.
I'm using the following to create the object:
Variant msWord = OleCreateObject ("Word.Application");
That works just fine. Trouble is, when I'm done, the process remains
alive. I've tried
msWord = Unassign;
but it won't work. The process is still there.
Thanks in advance,
Omer.




Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (ActiveX) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.