Home All Groups Group Topic Archive Search About

Attn Sue - Outlook automation not working in windows service

Author
29 Dec 2004 8:31 AM
Baskar
Hi Sue

I have written an application in VB 6.0 to read the mails from outlook and
upload the same to SQL DB. There is no issue in this is working fine.
But same application if i convert as a windows service it is not working
It is not identifying the mails items (Items.Count = 0)
(Service i have deployed in Windows XP)

Could you pls tell me what will be the problem?
Anticipating your reply

Baskar
Author
29 Dec 2004 1:54 PM
Ken Slovak
Don't ever run Outlook in a Windows service. It's not suited to it. Use CDO
1.21 or some other method of access in a service.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


Show quoteHide quote
"Baskar" <Bas***@discussions.microsoft.com> wrote in message
news:D9686986-646D-440D-B36F-E14B7CF9C24B@microsoft.com...
> Hi Sue
>
> I have written an application in VB 6.0 to read the mails from outlook and
> upload the same to SQL DB. There is no issue in this is working fine.
> But same application if i convert as a windows service it is not working
> It is not identifying the mails items (Items.Count = 0)
> (Service i have deployed in Windows XP)
>
> Could you pls tell me what will be the problem?
> Anticipating your reply
>
> Baskar
Are all your drivers up to date? click for free checkup

Author
5 Jan 2005 11:53 AM
Baskar
Hi Ken

Thanks for your reply
Could pls guide me how do i read mails from outlook 2002 using CDO.dll?
I have outlook 2002 in my system, but i couldn't find CDO.dll in my system

Expecting you valuable support
Baskar C.G

Show quoteHide quote
"Ken Slovak" wrote:

> Don't ever run Outlook in a Windows service. It's not suited to it. Use CDO
> 1.21 or some other method of access in a service.
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
> Reminder Manager, Extended Reminders, Attachment Options
> http://www.slovaktech.com/products.htm
>
>
> "Baskar" <Bas***@discussions.microsoft.com> wrote in message
> news:D9686986-646D-440D-B36F-E14B7CF9C24B@microsoft.com...
> > Hi Sue
> >
> > I have written an application in VB 6.0 to read the mails from outlook and
> > upload the same to SQL DB. There is no issue in this is working fine.
> > But same application if i convert as a windows service it is not working
> > It is not identifying the mails items (Items.Count = 0)
> > (Service i have deployed in Windows XP)
> >
> > Could you pls tell me what will be the problem?
> > Anticipating your reply
> >
> > Baskar
>
>
Author
5 Jan 2005 2:38 PM
Ken Slovak
CDO 1.21 is an optional installation for Outlook 2000 and later. You can
install it as Collaboration Data Objects from the Office CD using Add/Remove
Programs and expanding the Outlook tree node in the installation wizard.

For lots of examples of using CDO 1.21 see www.cdolive.com/cdo5.htm

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


Show quoteHide quote
"Baskar" <Bas***@discussions.microsoft.com> wrote in message
news:4FCD8236-FD2E-43BE-B2B9-3798D215152F@microsoft.com...
> Hi Ken
>
> Thanks for your reply
> Could pls guide me how do i read mails from outlook 2002 using CDO.dll?
> I have outlook 2002 in my system, but i couldn't find CDO.dll in my system
>
> Expecting you valuable support
> Baskar C.G
Author
6 Jan 2005 1:19 PM
Baskar
Could you pls tell me why i couldn't automate outlook from Windows Service?
Are there any limitations in windows service?

Basically requirement is
Every 10 min my App./Service should read mails from outlook and it has to be
updated in the SQL server DB.
I have developed a Standard EXE app which is working fine

Will deploying an EXE in the client place is a right way to achieve this?
Are there any other ways to achieve this apart from Std EXE & Win Service?

Excepting you valuable support to continue my work

By
Baskar

Show quoteHide quote
"Ken Slovak" wrote:

> CDO 1.21 is an optional installation for Outlook 2000 and later. You can
> install it as Collaboration Data Objects from the Office CD using Add/Remove
> Programs and expanding the Outlook tree node in the installation wizard.
>
> For lots of examples of using CDO 1.21 see www.cdolive.com/cdo5.htm
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
> Reminder Manager, Extended Reminders, Attachment Options
> http://www.slovaktech.com/products.htm
>
>
> "Baskar" <Bas***@discussions.microsoft.com> wrote in message
> news:4FCD8236-FD2E-43BE-B2B9-3798D215152F@microsoft.com...
> > Hi Ken
> >
> > Thanks for your reply
> > Could pls guide me how do i read mails from outlook 2002 using CDO.dll?
> > I have outlook 2002 in my system, but i couldn't find CDO.dll in my system
> >
> > Expecting you valuable support
> > Baskar C.G
>
>
Author
6 Jan 2005 2:18 PM
Ken Slovak
Outlook is not safe for use in a service, it has a UI and throws up modal
dialogs. Services must be able to run unattended. In addition, Outlook is
not thread safe. You can use it if you want but it goes against MS's own
documentation and all practical experience. See
http://support.microsoft.com/?kbid=237913 for 4 major reasons that Outlook
object model code is unsuitable for use in a Windows service.

For code in a service you generally use CDO 1.21 or Extended MAPI, not
Outlook code.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


Show quoteHide quote
"Baskar" <Bas***@discussions.microsoft.com> wrote in message
news:E385085A-13E9-434D-A373-B918F855CAFF@microsoft.com...
> Could you pls tell me why i couldn't automate outlook from Windows
> Service?
> Are there any limitations in windows service?
>
> Basically requirement is
> Every 10 min my App./Service should read mails from outlook and it has to
> be
> updated in the SQL server DB.
> I have developed a Standard EXE app which is working fine
>
> Will deploying an EXE in the client place is a right way to achieve this?
> Are there any other ways to achieve this apart from Std EXE & Win Service?
>
> Excepting you valuable support to continue my work
>
> By
> Baskar
Author
7 Jan 2005 6:03 AM
Baskar
Hi Ken,

Your explanations and links were really helpful to us to take the decision
is the right time.
We have dropped the idea to automate outlook from Win service
Thanks a lot for you excellent support

Wish you very happy New Year

By
Baskar C.G
Show quoteHide quote
"Ken Slovak" wrote:

> Outlook is not safe for use in a service, it has a UI and throws up modal
> dialogs. Services must be able to run unattended. In addition, Outlook is
> not thread safe. You can use it if you want but it goes against MS's own
> documentation and all practical experience. See
> http://support.microsoft.com/?kbid=237913 for 4 major reasons that Outlook
> object model code is unsuitable for use in a Windows service.
>
> For code in a service you generally use CDO 1.21 or Extended MAPI, not
> Outlook code.
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
> Reminder Manager, Extended Reminders, Attachment Options
> http://www.slovaktech.com/products.htm
>
>
> "Baskar" <Bas***@discussions.microsoft.com> wrote in message
> news:E385085A-13E9-434D-A373-B918F855CAFF@microsoft.com...
> > Could you pls tell me why i couldn't automate outlook from Windows
> > Service?
> > Are there any limitations in windows service?
> >
> > Basically requirement is
> > Every 10 min my App./Service should read mails from outlook and it has to
> > be
> > updated in the SQL server DB.
> > I have developed a Standard EXE app which is working fine
> >
> > Will deploying an EXE in the client place is a right way to achieve this?
> > Are there any other ways to achieve this apart from Std EXE & Win Service?
> >
> > Excepting you valuable support to continue my work
> >
> > By
> > Baskar
>
>
Author
6 Jan 2005 1:21 PM
Baskar
Could you pls tell me why i couldn't automate outlook from Windows Service?
Are there any limitations in windows service?

Basically requirement is
Every 10 min my App./Service should read mails from outlook and it has to be
updated in the SQL server DB.
I have developed a Standard EXE app which is working fine

Will deploying an EXE in the client place is a right way to achieve this?
Are there any other ways to achieve this apart from Std EXE & Win Service?

Excepting you valuable support to continue my work

By
Baskar C.G


Show quoteHide quote
"Ken Slovak" wrote:

> CDO 1.21 is an optional installation for Outlook 2000 and later. You can
> install it as Collaboration Data Objects from the Office CD using Add/Remove
> Programs and expanding the Outlook tree node in the installation wizard.
>
> For lots of examples of using CDO 1.21 see www.cdolive.com/cdo5.htm
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
> Reminder Manager, Extended Reminders, Attachment Options
> http://www.slovaktech.com/products.htm
>
>
> "Baskar" <Bas***@discussions.microsoft.com> wrote in message
> news:4FCD8236-FD2E-43BE-B2B9-3798D215152F@microsoft.com...
> > Hi Ken
> >
> > Thanks for your reply
> > Could pls guide me how do i read mails from outlook 2002 using CDO.dll?
> > I have outlook 2002 in my system, but i couldn't find CDO.dll in my system
> >
> > Expecting you valuable support
> > Baskar C.G
>
>

Bookmark and Share