T
Tim Shirley
I'm attempting to access the entries in an Outlook user's contact list
from within an Outlook plugin in C# (using Visual Studio 2003 and
Outlook 2003). The following block of code works correctly, until it
gets to the last line (attempting to cast one of the items from the
contact list into an AddressEntry object) and then it hangs:
Outlook.NameSpace outlookNS = new
Outlook.ApplicationClass().GetNamespace("MAPI");
Outlook.Items coll =
outlookNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts).Items;
MessageBox.Show("Got collection. item count is " + coll.Count);
MessageBox.Show("First item uncast is " + coll.GetFirst());
MessageBox.Show("First item cast is " + ((Outlook.AddressEntry)
(coll.GetFirst())));
I've tried this on a couple of different machines using Outlook 2003,
but it hangs at the same spot on both. (The message box saying "First
item cast is ..." never appears.) Any ideas what's going on here?
Thanks!
from within an Outlook plugin in C# (using Visual Studio 2003 and
Outlook 2003). The following block of code works correctly, until it
gets to the last line (attempting to cast one of the items from the
contact list into an AddressEntry object) and then it hangs:
Outlook.NameSpace outlookNS = new
Outlook.ApplicationClass().GetNamespace("MAPI");
Outlook.Items coll =
outlookNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts).Items;
MessageBox.Show("Got collection. item count is " + coll.Count);
MessageBox.Show("First item uncast is " + coll.GetFirst());
MessageBox.Show("First item cast is " + ((Outlook.AddressEntry)
(coll.GetFirst())));
I've tried this on a couple of different machines using Outlook 2003,
but it hangs at the same spot on both. (The message box saying "First
item cast is ..." never appears.) Any ideas what's going on here?
Thanks!