Board index » delphi » TOulookApplication initalisation

TOulookApplication initalisation


2004-10-16 09:06:57 AM
delphi60
Hi
I'm using TOutlookApplication and if I use it when Outlook isn't running my
program crashes.
Does anyone know how to check and see if Outlook is running so I can avoid
using it if this is the case?
Also, as a side question, my instance of TOutlookApplication appears to be
working even though I am not doing any initalisation or connecting that I can
see. The autoconnect is false. Presumably it works out to establish
communication with Outlook when I try and access information, but if anyone
has any comments on this it would be good. I would like to do the right thing
here (initially I wasn't even using Create and it still seemed to work,
although I now have that).
Thanks very much for all the advice I have been getting.
David.
 
 

Re:TOulookApplication initalisation

"David Downie" <XXXX@XXXXX.COM>writes
Quote
Also, as a side question, my instance of TOutlookApplication appears to be
working even though I am not doing any initalisation or connecting that I
can see. The autoconnect is false. Presumably it works out to establish
communication with Outlook when I try and access information, but if
anyone has any comments on this it would be good. I would like to do the right
thing here (initially I wasn't even using Create and it still seemed to
work, although I now have that).
It appears it does do this on a needs basis if AutoConnect is true. I still
need to work out how to test to see if a connection has been made (or at a
higher level if Outlook is running and able to be connected with).
 

Re:TOulookApplication initalisation

<<David Downie:
Presumably it works out to establish communication with
Outlook when I try and access information
Quote
>
All the server components call Connect if you call another
method before Connecting manually. (IMO this is annoying,
because you can not check whether a component has connected
by examining DefaultInterface, but that is how it is.)
--
Deborah Pate (TeamB) delphi-jedi.org
TeamB don't see posts sent via Google or ISPs
Use the real Borland server: newsgroups.borland.com
www.borland.com/newsgroups/genl_faqs.html
 

Re:TOulookApplication initalisation

"Deborah Pate (TeamB)" <XXXX@XXXXX.COM>wrote in
message news:XXXX@XXXXX.COM...
Quote
All the server components call Connect if you call another
method before Connecting manually. (IMO this is annoying,
because you can not check whether a component has connected
by examining DefaultInterface, but that is how it is.)
Hang on - so if I try and connect manually, I can check whether or not it
works by looking at "DefaultInterface"?
If so, could you give me a pointer on how to access this?
At the moment, I am just catching the exception and assuming it hasn't
connected, which I know in my heart is bad practice.
Thanks!
David
 

Re:TOulookApplication initalisation

<<David Downie:
so if I try and connect manually, I can check whether or
not it works by looking at "DefaultInterface"?
Quote
>
No, that is what I am saying. When you look at
DefaultInterface the server component will call Connect.
--
Deborah Pate (TeamB) delphi-jedi.org
TeamB don't see posts sent via Google or ISPs
Use the real Borland server: newsgroups.borland.com
www.borland.com/newsgroups/genl_faqs.html
 

Re:TOulookApplication initalisation

<<David Downie:
I can check whether or not it works by looking at
"DefaultInterface"?
Quote
>
FWIW you can do this if you use an interface variable to
start Word, and then use the component's ConnectTo method
to connect the component. (See my site for details:
www.djpate.freeserve.co.uk/Automation.htm )
But the Connect method is handy. I generally dislike using
try..except clauses, but they are sometimes unavoidable in
automation, anyway.
--
Deborah Pate (TeamB) delphi-jedi.org
TeamB don't see posts sent via Google or ISPs
Use the real Borland server: newsgroups.borland.com
www.borland.com/newsgroups/genl_faqs.html
 

Re:TOulookApplication initalisation

"Deborah Pate (TeamB)" <XXXX@XXXXX.COM>wrote in
message news:XXXX@XXXXX.COM...
Quote
FWIW you can do this if you use an interface variable to
start Word, and then use the component's ConnectTo method
to connect the component. (See my site for details:
www.djpate.freeserve.co.uk/Automation.htm )
Ah so that is your website is it. I got confused quite quickly after going
there, so I think I will stick with what I have managed to get to work!
Quote
But the Connect method is handy. I generally dislike using
try..except clauses, but they are sometimes unavoidable in
automation, anyway.
That's good to know. I don't feel so bad now.
David.