M
Mk23
Hi
In a synchronisation application for Outlook 2003 i have the problem, that
the reading of the Outlook.Appointment.subject property fails. The
application stands still by reading, without Exception or any other
information.
Code:
//Loop all appointments
for (object itemObject = restrictedItems.GetFirst(); itemObject != null;
itemObject = restrictedItems.GetNext())
{
File.AppendAllText(path, Environment.NewLine + "Loop item: " + ++i);
if (itemObject is Outlook.AppointmentItem)
{
File.AppendAllText(path, Environment.NewLine + "Item is appointment
item: " + i);
Outlook.AppointmentItem appointment = itemObject as
Outlook.AppointmentItem;
try
{
File.AppendAllText(path, Environment.NewLine + "Item after cast: " + i);
if (appointment != null)
{
File.AppendAllText(path, Environment.NewLine + "Start reading
Properties: " + i);
string subject = appointment.Subject;
File.AppendAllText(path, Environment.NewLine + "Item Subject read:
" + i + " = " + subject);
Outlook.OlResponseStatus responseStatus =
appointment.ResponseStatus;
File.AppendAllText(path, Environment.NewLine + "Item
Responsestatus read: " + i + "=" + responseStatus);
DateTime start = appointment.Start;
File.AppendAllText(path, Environment.NewLine + "Item Start read: "
+ i + "=" + start);
DateTime end = appointment.End;
File.AppendAllText(path, Environment.NewLine + "Item End read: " +
i + "=" + end);
}
else
{
File.AppendAllText(path, Environment.NewLine + "Item is null: " +
i);
}
}
catch (Exception e)
{
File.AppendAllText(path, Environment.NewLine + "Stacktrace: " + i++ +
" " + e.StackTrace);
}
}
}
The last Output is:
Loop item: 8
Item is appointment item: 8
Item after cast: 8
Start reading Properties: 8
The stop is not allways on the same item, and sometimes it runs without any
fault.
Has someone an idea?
Thanks
In a synchronisation application for Outlook 2003 i have the problem, that
the reading of the Outlook.Appointment.subject property fails. The
application stands still by reading, without Exception or any other
information.
Code:
//Loop all appointments
for (object itemObject = restrictedItems.GetFirst(); itemObject != null;
itemObject = restrictedItems.GetNext())
{
File.AppendAllText(path, Environment.NewLine + "Loop item: " + ++i);
if (itemObject is Outlook.AppointmentItem)
{
File.AppendAllText(path, Environment.NewLine + "Item is appointment
item: " + i);
Outlook.AppointmentItem appointment = itemObject as
Outlook.AppointmentItem;
try
{
File.AppendAllText(path, Environment.NewLine + "Item after cast: " + i);
if (appointment != null)
{
File.AppendAllText(path, Environment.NewLine + "Start reading
Properties: " + i);
string subject = appointment.Subject;
File.AppendAllText(path, Environment.NewLine + "Item Subject read:
" + i + " = " + subject);
Outlook.OlResponseStatus responseStatus =
appointment.ResponseStatus;
File.AppendAllText(path, Environment.NewLine + "Item
Responsestatus read: " + i + "=" + responseStatus);
DateTime start = appointment.Start;
File.AppendAllText(path, Environment.NewLine + "Item Start read: "
+ i + "=" + start);
DateTime end = appointment.End;
File.AppendAllText(path, Environment.NewLine + "Item End read: " +
i + "=" + end);
}
else
{
File.AppendAllText(path, Environment.NewLine + "Item is null: " +
i);
}
}
catch (Exception e)
{
File.AppendAllText(path, Environment.NewLine + "Stacktrace: " + i++ +
" " + e.StackTrace);
}
}
}
The last Output is:
Loop item: 8
Item is appointment item: 8
Item after cast: 8
Start reading Properties: 8
The stop is not allways on the same item, and sometimes it runs without any
fault.
Has someone an idea?
Thanks