Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » OleControlSite: conntect to an existing instance
OleControlSite: conntect to an existing instance [message #534716] Thu, 20 May 2010 06:14 Go to next message
Eclipse UserFriend
Originally posted by: Ludger.Heisterkamp.technotrans.de

Hello,

I am automating MS Word with an OleControlSite, which works prettty well:

new OleControlSite(frame, SWT.NONE, "Word.Application");

This code always opens a new Word instance. Is it possible to connect
to an existing instance of Word, if there is one?

Kind regards,
Ludger Heisterkamp
Re: OleControlSite: conntect to an existing instance [message #534797 is a reply to message #534716] Thu, 20 May 2010 11:34 Go to previous messageGo to next message
Vijay RajFriend
Messages: 608
Registered: July 2009
Senior Member
Quote:
Is it possible to connect
to an existing instance of Word, if there is one?


I dont think so...
but i think you can open the word document which you want in the oleclient...


---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
Antw: Re: OleControlSite: conntect to an existing instance [message #535877 is a reply to message #534797] Wed, 26 May 2010 07:22 Go to previous message
Eclipse UserFriend
Originally posted by: Ludger.Heisterkamp.technotrans.de

Yes, that is right. This is the way I'm working right now.
But Word sometimes has problems accessing the normal.dot
when multiple instances are running at the same time.
To avoid these problems it would be nice to have the
possibility to access an existing instance.

In VB it possible via the GetObject method:
Dim wdapp As Object
Set wdapp = GetObject(, "Word.Application")

But there seems to be no equivalent method in SWT...

Regards,
LH

>>> vijay<vijay.rajonline@gmail.com> schrieb am Donnerstag, 20. Mai 2010 um
13:34 in Nachricht <ht36o0$sbo$1@build.eclipse.org>:
> Quote:
>> Is it possible to connect
>> to an existing instance of Word, if there is one?
>
> I dont think so...
> but i think you can open the word document which you want in the
> oleclient...
Previous Topic:Auto-complete functionality
Next Topic:Monitoring Tool with SWT
Goto Forum:
  


Current Time: Sat Aug 24 17:58:34 GMT 2019

Powered by FUDForum. Page generated in 0.02219 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top