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 

TOutlookApplication question

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation
View previous topic :: View next topic  
Author Message
Philip Colley
Guest





PostPosted: Thu Apr 26, 2007 8:12 am    Post subject: TOutlookApplication question Reply with quote



Hi

I am using TOutlookApplication and Redemption to access Outlooks
Tasks/Appointments and Emails and all works well, but I have noticed that
when I start Outlook, connect and it remains showing in Task Manager,
Outlook does not seem to be doing any Send/Receive operations.

I have tried using Redemptions MAPIUtils and calling DeliverNow which from
the description "Forces the delivery of incoming and/or outgoing messages"
should help.

This is my code that creates the Outlook app:-
fOutlook := TOutlookApplication.Create(Application.MainForm);
fOutlook.ConnectKind := (ckRunningOrNew);
fOutlook.OnNewMail := NewMailArrived;

and then when I need some info I do this:-
fOutlook.Connect;
fNameSpace := fOutlook.GetNamespace('MAPI');
fNameSpace.Logon('', '', False, False);

Only do this when I have finished with Outlook and I want to close it:-
fNameSpace.Logoff;
fNameSpace := nil;
fOutlook.Quit;
fOutlook.Disconnect;


Thanks
Phil
Back to top
Dmitry Streblechenko
Guest





PostPosted: Thu Apr 26, 2007 10:14 pm    Post subject: Re: TOutlookApplication question Reply with quote



Ever since MS removed the spooler in Outlook 2002, MAPIUtils.DeliverNothing
does not do anything.
Have you tried to use the Namespace.SyncObjects collection to initiate
Send/Receive (SyncObject.Start)?
Do you have send/receive groups defined? Do you have any accounts in them?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Philip Colley" <pjcolley (AT) globalnet (DOT) co.uk> wrote in message
news:46304caf (AT) newsgroups (DOT) borland.com...
Quote:
Hi

I am using TOutlookApplication and Redemption to access Outlooks
Tasks/Appointments and Emails and all works well, but I have noticed that
when I start Outlook, connect and it remains showing in Task Manager,
Outlook does not seem to be doing any Send/Receive operations.

I have tried using Redemptions MAPIUtils and calling DeliverNow which from
the description "Forces the delivery of incoming and/or outgoing messages"
should help.

This is my code that creates the Outlook app:-
fOutlook := TOutlookApplication.Create(Application.MainForm);
fOutlook.ConnectKind := (ckRunningOrNew);
fOutlook.OnNewMail := NewMailArrived;

and then when I need some info I do this:-
fOutlook.Connect;
fNameSpace := fOutlook.GetNamespace('MAPI');
fNameSpace.Logon('', '', False, False);

Only do this when I have finished with Outlook and I want to close it:-
fNameSpace.Logoff;
fNameSpace := nil;
fOutlook.Quit;
fOutlook.Disconnect;


Thanks
Phil
Back to top
Dmitry Streblechenko
Guest





PostPosted: Fri Apr 27, 2007 8:12 am    Post subject: Re: TOutlookApplication question Reply with quote



Actually only once instance of outlook.exe is running at all times, you just
get multiple explorers.
Didyou try to use Namespace.SyncObjects? That should work even if no
explorers or inspectors are open.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Philip Colley" <pjcolley (AT) globalnet (DOT) co.uk> wrote in message
news:46318538$1 (AT) newsgroups (DOT) borland.com...
Quote:
Hi Dmitry

This is my Outlook 2003 that I use every day so all accounts are set up
correctly.

What I noticed is that when Outlook is started in this way it shows in the
Task Manager but does not get a button in the Task Bar. So I have now
added this to my connect routine :-

fldr := fNameSpace.GetDefaultFolder(olFolderInbox)
fldr.Display;

This makes Outlook have a button in the Task Bar and it does it's
Send/Receive correctly, so problem solved I thought. Not quite, If Outlook
is already open when this code runs I get two Outlooks running, not just
in Task Manager but two Outlook windows.

Idealy what I want is Outlook being opened normally by my code and doing
it's own thing regarding Send/Receive not me have to keep calling it.

Thanks
Phil


"Dmitry Streblechenko" <dmitry (AT) dimastr (DOT) com> wrote in message
news:4630dd41$1 (AT) newsgroups (DOT) borland.com...
Ever since MS removed the spooler in Outlook 2002,
MAPIUtils.DeliverNothing does not do anything.
Have you tried to use the Namespace.SyncObjects collection to initiate
Send/Receive (SyncObject.Start)?
Do you have send/receive groups defined? Do you have any accounts in
them?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Philip Colley" <pjcolley (AT) globalnet (DOT) co.uk> wrote in message
news:46304caf (AT) newsgroups (DOT) borland.com...
Hi

I am using TOutlookApplication and Redemption to access Outlooks
Tasks/Appointments and Emails and all works well, but I have noticed
that when I start Outlook, connect and it remains showing in Task
Manager, Outlook does not seem to be doing any Send/Receive operations.

I have tried using Redemptions MAPIUtils and calling DeliverNow which
from the description "Forces the delivery of incoming and/or outgoing
messages" should help.

This is my code that creates the Outlook app:-
fOutlook :=
TOutlookApplication.Create(Application.MainForm);
fOutlook.ConnectKind := (ckRunningOrNew);
fOutlook.OnNewMail := NewMailArrived;

and then when I need some info I do this:-
fOutlook.Connect;
fNameSpace := fOutlook.GetNamespace('MAPI');
fNameSpace.Logon('', '', False, False);

Only do this when I have finished with Outlook and I want to close it:-
fNameSpace.Logoff;
fNameSpace := nil;
fOutlook.Quit;
fOutlook.Disconnect;


Thanks
Phil



Back to top
Philip Colley
Guest





PostPosted: Fri Apr 27, 2007 8:12 am    Post subject: Re: TOutlookApplication question Reply with quote

Hi Dmitry

This is my Outlook 2003 that I use every day so all accounts are set up
correctly.

What I noticed is that when Outlook is started in this way it shows in the
Task Manager but does not get a button in the Task Bar. So I have now added
this to my connect routine :-

fldr := fNameSpace.GetDefaultFolder(olFolderInbox)
fldr.Display;

This makes Outlook have a button in the Task Bar and it does it's
Send/Receive correctly, so problem solved I thought. Not quite, If Outlook
is already open when this code runs I get two Outlooks running, not just in
Task Manager but two Outlook windows.

Idealy what I want is Outlook being opened normally by my code and doing
it's own thing regarding Send/Receive not me have to keep calling it.

Thanks
Phil


"Dmitry Streblechenko" <dmitry (AT) dimastr (DOT) com> wrote in message
news:4630dd41$1 (AT) newsgroups (DOT) borland.com...
Quote:
Ever since MS removed the spooler in Outlook 2002,
MAPIUtils.DeliverNothing does not do anything.
Have you tried to use the Namespace.SyncObjects collection to initiate
Send/Receive (SyncObject.Start)?
Do you have send/receive groups defined? Do you have any accounts in them?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Philip Colley" <pjcolley (AT) globalnet (DOT) co.uk> wrote in message
news:46304caf (AT) newsgroups (DOT) borland.com...
Hi

I am using TOutlookApplication and Redemption to access Outlooks
Tasks/Appointments and Emails and all works well, but I have noticed that
when I start Outlook, connect and it remains showing in Task Manager,
Outlook does not seem to be doing any Send/Receive operations.

I have tried using Redemptions MAPIUtils and calling DeliverNow which
from the description "Forces the delivery of incoming and/or outgoing
messages" should help.

This is my code that creates the Outlook app:-
fOutlook := TOutlookApplication.Create(Application.MainForm);
fOutlook.ConnectKind := (ckRunningOrNew);
fOutlook.OnNewMail := NewMailArrived;

and then when I need some info I do this:-
fOutlook.Connect;
fNameSpace := fOutlook.GetNamespace('MAPI');
fNameSpace.Logon('', '', False, False);

Only do this when I have finished with Outlook and I want to close it:-
fNameSpace.Logoff;
fNameSpace := nil;
fOutlook.Quit;
fOutlook.Disconnect;


Thanks
Phil


Back to top
Philip Colley
Guest





PostPosted: Fri Apr 27, 2007 1:12 pm    Post subject: Re: TOutlookApplication question Reply with quote

Dmitry

No have not yet tried Namespace.SyncObjects, but I will when I get back
latter.

Can I check for open explorers before calling Display? Or can I check that
Outlook is already running?

Thanks
Phil

"Dmitry Streblechenko" <dmitry (AT) dimastr (DOT) com> wrote in message
news:4631a5d9$1 (AT) newsgroups (DOT) borland.com...
Quote:
Actually only once instance of outlook.exe is running at all times, you
just get multiple explorers.
Didyou try to use Namespace.SyncObjects? That should work even if no
explorers or inspectors are open.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Philip Colley" <pjcolley (AT) globalnet (DOT) co.uk> wrote in message
news:46318538$1 (AT) newsgroups (DOT) borland.com...
Hi Dmitry

This is my Outlook 2003 that I use every day so all accounts are set up
correctly.

What I noticed is that when Outlook is started in this way it shows in
the Task Manager but does not get a button in the Task Bar. So I have now
added this to my connect routine :-

fldr := fNameSpace.GetDefaultFolder(olFolderInbox)
fldr.Display;

This makes Outlook have a button in the Task Bar and it does it's
Send/Receive correctly, so problem solved I thought. Not quite, If
Outlook is already open when this code runs I get two Outlooks running,
not just in Task Manager but two Outlook windows.

Idealy what I want is Outlook being opened normally by my code and doing
it's own thing regarding Send/Receive not me have to keep calling it.

Thanks
Phil


"Dmitry Streblechenko" <dmitry (AT) dimastr (DOT) com> wrote in message
news:4630dd41$1 (AT) newsgroups (DOT) borland.com...
Ever since MS removed the spooler in Outlook 2002,
MAPIUtils.DeliverNothing does not do anything.
Have you tried to use the Namespace.SyncObjects collection to initiate
Send/Receive (SyncObject.Start)?
Do you have send/receive groups defined? Do you have any accounts in
them?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Philip Colley" <pjcolley (AT) globalnet (DOT) co.uk> wrote in message
news:46304caf (AT) newsgroups (DOT) borland.com...
Hi

I am using TOutlookApplication and Redemption to access Outlooks
Tasks/Appointments and Emails and all works well, but I have noticed
that when I start Outlook, connect and it remains showing in Task
Manager, Outlook does not seem to be doing any Send/Receive operations.

I have tried using Redemptions MAPIUtils and calling DeliverNow which
from the description "Forces the delivery of incoming and/or outgoing
messages" should help.

This is my code that creates the Outlook app:-
fOutlook :=
TOutlookApplication.Create(Application.MainForm);
fOutlook.ConnectKind := (ckRunningOrNew);
fOutlook.OnNewMail := NewMailArrived;

and then when I need some info I do this:-
fOutlook.Connect;
fNameSpace := fOutlook.GetNamespace('MAPI');
fNameSpace.Logon('', '', False, False);

Only do this when I have finished with Outlook and I want to close it:-
fNameSpace.Logoff;
fNameSpace := nil;
fOutlook.Quit;
fOutlook.Disconnect;


Thanks
Phil





Back to top
Dmitry Streblechenko
Guest





PostPosted: Sat Apr 28, 2007 1:08 am    Post subject: Re: TOutlookApplication question Reply with quote

Yep, just check Application.Explorers.Count. Or
Application.Inspectors.Count.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Philip Colley" <pjcolley (AT) globalnet (DOT) co.uk> wrote in message
news:4631b054 (AT) newsgroups (DOT) borland.com...
Quote:
Dmitry

No have not yet tried Namespace.SyncObjects, but I will when I get back
latter.

Can I check for open explorers before calling Display? Or can I check that
Outlook is already running?

Thanks
Phil

"Dmitry Streblechenko" <dmitry (AT) dimastr (DOT) com> wrote in message
news:4631a5d9$1 (AT) newsgroups (DOT) borland.com...
Actually only once instance of outlook.exe is running at all times, you
just get multiple explorers.
Didyou try to use Namespace.SyncObjects? That should work even if no
explorers or inspectors are open.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Philip Colley" <pjcolley (AT) globalnet (DOT) co.uk> wrote in message
news:46318538$1 (AT) newsgroups (DOT) borland.com...
Hi Dmitry

This is my Outlook 2003 that I use every day so all accounts are set up
correctly.

What I noticed is that when Outlook is started in this way it shows in
the Task Manager but does not get a button in the Task Bar. So I have
now added this to my connect routine :-

fldr := fNameSpace.GetDefaultFolder(olFolderInbox)
fldr.Display;

This makes Outlook have a button in the Task Bar and it does it's
Send/Receive correctly, so problem solved I thought. Not quite, If
Outlook is already open when this code runs I get two Outlooks running,
not just in Task Manager but two Outlook windows.

Idealy what I want is Outlook being opened normally by my code and doing
it's own thing regarding Send/Receive not me have to keep calling it.

Thanks
Phil


"Dmitry Streblechenko" <dmitry (AT) dimastr (DOT) com> wrote in message
news:4630dd41$1 (AT) newsgroups (DOT) borland.com...
Ever since MS removed the spooler in Outlook 2002,
MAPIUtils.DeliverNothing does not do anything.
Have you tried to use the Namespace.SyncObjects collection to initiate
Send/Receive (SyncObject.Start)?
Do you have send/receive groups defined? Do you have any accounts in
them?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Philip Colley" <pjcolley (AT) globalnet (DOT) co.uk> wrote in message
news:46304caf (AT) newsgroups (DOT) borland.com...
Hi

I am using TOutlookApplication and Redemption to access Outlooks
Tasks/Appointments and Emails and all works well, but I have noticed
that when I start Outlook, connect and it remains showing in Task
Manager, Outlook does not seem to be doing any Send/Receive
operations.

I have tried using Redemptions MAPIUtils and calling DeliverNow which
from the description "Forces the delivery of incoming and/or outgoing
messages" should help.

This is my code that creates the Outlook app:-
fOutlook :=
TOutlookApplication.Create(Application.MainForm);
fOutlook.ConnectKind := (ckRunningOrNew);
fOutlook.OnNewMail := NewMailArrived;

and then when I need some info I do this:-
fOutlook.Connect;
fNameSpace := fOutlook.GetNamespace('MAPI');
fNameSpace.Logon('', '', False, False);

Only do this when I have finished with Outlook and I want to close
it:-
fNameSpace.Logoff;
fNameSpace := nil;
fOutlook.Quit;
fOutlook.Disconnect;


Thanks
Phil







Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation 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.