 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Omer Eisenberg Guest
|
Posted: Wed Jun 16, 2004 8:28 am Post subject: Deleting / Destroyinh MS-Word OLE |
|
|
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
|
Posted: Wed Jun 16, 2004 5:16 pm Post subject: Re: Deleting / Destroyinh MS-Word OLE |
|
|
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 |
|
 |
|
|
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
|
|