Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsWindows Server 2003Windows 2000Windows NTSmall Business ServerVirtual ServerExchange ServerIISHost Integration ServerISA ServerSMSWSUSMOMWindows Media ServerSecurityCertification
Related Topics
SQL ServerMS WindowsMS OfficePC HardwareMore Topics ...

Windows Server Forum / Exchange Server / Applications / July 2006

Tip: Looking for answers? Try searching our database.

Exchange integration using Visual Basic and CDO

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jose Enrique - 21 Jul 2006 13:07 GMT
My program is a NT service which look for an user appointment in a Exchange
2000 server which match with the present time to decide if the user is busy
or free. It reads the user from a INI file. I'm using CDO and Visual Basic
to implement the program.

My problem is the following:
Sometimes the program cannot logon to an user mailbox and it ends
unexpectedly or it cannot continue with the logon process.

The code I use is the following:

       strProfileInfo = g_sExchangeServer & vbLf & ObjMailbox.Name

      Set ObjSession = New Session

      ObjSession.Logon "", "", False, True, 0, True, strProfileInfo

I'd be very grateful if anyone could help me with my problem...
Dan Mitchell - 21 Jul 2006 18:11 GMT
> Sometimes the program cannot logon to an user mailbox and it ends
> unexpectedly or it cannot continue with the logon process.
[quoted text clipped - 8 lines]
>
> I'd be very grateful if anyone could help me with my problem...

What exactly _is_ your problem? Is it handling the error? Is it that you
can't log into some mailboxes and you expect you should be able to? What's
the error you're seeing, and where does it show up? What's different
between the mailboxes that you can't log into and the ones that you can
log into? Is your app running as an account that has access to the
mailboxes in question?

Is there some reason you aren't using freebusy data to do this?

-- dan
Jose Enrique - 26 Jul 2006 08:16 GMT
Thanks for answering. Sorry for not answering you before. I have been in the
hospital becasuse my grandmother was ill.
I use an account which has full acesss to all mailboxes.

But how I can use freebusy data? I'd be very gratefull if you could help me.

> > Sometimes the program cannot logon to an user mailbox and it ends
> > unexpectedly or it cannot continue with the logon process.
[quoted text clipped - 19 lines]
>
>  -- dan
Dan Mitchell - 26 Jul 2006 17:42 GMT
>Thanks for answering. Sorry for not answering you before. I have been in
>the hospital becasuse my grandmother was ill.

Sorry to hear that -- hope she's doing better now.

> But how I can use freebusy data? I'd be very gratefull if you could
> help me.

Something like this -- m is a CDO1.21 Message object, just as a
convenient way to get at Recipients:

   Dim r As MAPI.Recipient
   Set r = m.Recipients.Add("danielmitchell")
   
   Debug.Print r.GetFreeBusy(#7/24/2006#, #7/25/2006#, 15)

and that'll give me a string with my free/busy status between those
times, one character for every 15 minutes; you'd presumably pass in time
around "now" for your application.

-- dan
Jose Enrique - 27 Jul 2006 08:15 GMT
Thanks for answering again. My grandmother is still in the hospital and I go
to be with her each day until she come back to home.

I don't understand the code very well. How I getfreebusy state for a mailbox
which exists in the system? In this code you create a recipients, don't you?
Sorry for bothering you. I'd be very grateful if you could help me.

José Enrique

> >Thanks for answering. Sorry for not answering you before. I have been in
> >the hospital becasuse my grandmother was ill.
[quoted text clipped - 17 lines]
>
>  -- dan
Dan Mitchell - 27 Jul 2006 17:31 GMT
"Jose Enrique" <eaguado@jusan.es> wrote in
> I don't understand the code very well. How I getfreebusy state for a
> mailbox which exists in the system? In this code you create a
> recipients, don't you?

That's correct. You log into some mailbox (doesn't matter which), create
a Recipient object that corresponds to the mailbox that you want to get
information about, and then call GetFreeBusy on the Recipient object.

Because freebusy information is published for other people to use in
Outlook, person A can read freebusy information for person B without
having to log into their mailbox.

(the settings in Outlook are in Tools | Options | Preferences | Calendar
Options | Free/Busy Options)

-- dan
Jose Enrique - 28 Jul 2006 10:06 GMT
Thanks for helping me again...

This is the code I have add
strProfileInfo = g_cServidorExchange & vbLf &
"SLExchange@DESARROLLO.desarrollo.es"
Set ObjSession = New Session
ObjSession.Logon g_cPerfilExchange

Set ObjMessage = ObjSession.Inbox.Messages.Add
Set ObjRecipColl = ObjMessage.Recipients

'ObjBuzon.Nombre is the Exchange alias of the user whose state I want to get
Set ObjOneRecip = ObjRecipColl.Add(ObjBuzon.Nombre)

'Specify the date/time of the beginning of the first time slot.
StartTime = Format$(Now, "Short Date")

'Specify the date/time of the end of the last time slot.
EndTime = Format$(DateAdd("m",3,Now),"Short Date")

Interval = 1

FreeBusy = ObjOneRecip.GetFreeBusy(StartTime, EndTime, Interval)

But when the program try to get the freebusystate it appears the error:
[Collaboration Data Objects - [MAPI_E_NO_SUPPORT(80040102)]]
Do you know what I'm doing bad.

Thanks again for you help..

> "Jose Enrique" <eaguado@jusan.es> wrote in
> > I don't understand the code very well. How I getfreebusy state for a
[quoted text clipped - 13 lines]
>
>  -- dan
Dan Mitchell - 31 Jul 2006 20:42 GMT
> strProfileInfo = g_cServidorExchange & vbLf &
> "SLExchange@DESARROLLO.desarrollo.es"
> Set ObjSession = New Session
> ObjSession.Logon g_cPerfilExchange

This should be ObjSession.Logon profileInfo := strProfileInfo, if
you're trying to use dynamic profiles. Or if g_cPerfilExchange is the
name of a profile, you don't need strProfileInfo.

> [snip]
> FreeBusy = ObjOneRecip.GetFreeBusy(StartTime, EndTime, Interval)
>
> But when the program try to get the freebusystate it appears the
> error: [Collaboration Data Objects - [MAPI_E_NO_SUPPORT(80040102)]]
> Do you know what I'm doing bad.

It looks fine, and your code works when I try it. Are you sure that
ObjOneRecip is a real person? (can you read, say, the Name from that
person, or something else to make sure that it's working).

Does the person that you're trying to get freebusy info for have it
turned on? (if you use Outlook to try and book a meeting with them, can
you see when they're available by using the Scheduling tab in the 'new
meeting' window)?

-- dan
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.