And the code that runs in your Word template is triggered by ? My
understanding is that this is some code that automatically runs when Word is
launched.
Possible options would be :
- to have this code call Outlook rather than your main code (but you are
still "forking" as it will run inside Word in parallel with your main code,
tirggred by Word launch)
- don't set up Word to autorun this code but rather expose it as en entry
point (as you have done for your com object) so that you main vb.net code
can calls explicitely this "entry point" when appropriate instead of being
called by Word at launch time.
i.e. rather than to add some code to simulate sequential code my preference
would be to reorganize my code so that it runs sequentially...
--
Patrice
"SDecou" <SD****@discussions.microsoft.coma écrit dans le message de
groupe de discussion :
BA**********************************@microsoft.com...
The project consists of a COM object and a Word template created using
VB.net. After the Word template loads, I am calling a sub called Main that
is
retrieving my Outlook Contacts folder and then will list all the contacts
in
that folder. After my COM object finishes it's processing, I would like
to
return to my Word template the selected Outlook contact object from the
COM.
But right now, when we call the COM object, the code in the COM object
runs
at the same time as the code that is running in our word template. We're
unable to control this process. We've looked at threads, but we're not
sure
if that's the best approach.
We are not calling a class. We are calling a a sub called "Main" in the
COM
object.
"Patrice" wrote:
>You may want to provide some more details as it looks like you are
already
doing something special (the usual behavior for a call is to return only
when done).
Also you don't call a class so you likely call your code using something
else than "Call MyClass"
--
Patrice
"SDecou" <SD****@discussions.microsoft.coma crit dans le message de
groupe de discussion :
25**********************************@microsoft.com...
I have written a COM object that I am calling from a separate VB.net
project.
I am calling the DLL by using "Call myClass". I need to know when the
DLL
has finished processing before it returns to the main project to run
more
code. Do I need to use threads? Is there an example that will lead me
in
the right direction?