Calendar access problems when Outlook is taskbar resident...

R

rodzilla

I am having problems when accessing Outlook's default Calendar folder
after "exiting" Outlook - ie Outlook's main form closed, but Outlook's
icon still resident in the taskbar. Since Outlook is frequently in this
state, I need a solution that deals with all possible states....

The code below just loops through the Calendar appointment items...It
runs fine when Outlook is either visible-and-running, or when Outlook
is completely stopped and not memory resident (I exit Outlook and then
completely kill Outlook with Windows Task Manager).

The code below encounters NO AppointmenItems when Outlook is in the
memory-resident/icon-only in-between state.

I have tried the same routine using:
oNS.Logon( , , , True)
to try force a new Outlook session, but the problem is the same...

Any help is GREATLY appreciated

Rod Kimmel

------------------------------------------------------------------------------------
oApp = CreateObject("Outlook.Application")
oNS = oApp.GetNamespace("mapi")
oNS.Logon()
Dim oCalendar As Outlook.MAPIFolder =
oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar)
Dim oItems As Outlook.Items = oCalendar.Items
If oItems.Count > 0 Then
Dim ictr As Integer
Dim oAppt As Outlook.AppointmentItem
Dim myObj As Object = oItems.GetFirst
For ictr = 1 To oItems.Count
If TypeOf (myObj) Is Outlook.AppointmentItem Then
oAppt = CType(myObj, Outlook.AppointmentItem)
...
End If
End IF
-------------------------------------------------------------------------------------------
 
B

Brian Tillman

I am having problems when accessing Outlook's default Calendar folder
after "exiting" Outlook - ie Outlook's main form closed, but Outlook's
icon still resident in the taskbar. Since Outlook is frequently in
this state, I need a solution that deals with all possible states....

This is an abnormal state and indicates a problem on the person's PC. I
don't think you need to allow for it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top