Hello,
I have an MDI form.
I open different forms as child from the MDI.
All forms are office2010form.
when i use following code the system is ridiculously slow:
DataTable dt = new DataTable();
DataColumn dcId = new DataColumn("Id");
DataColumn dcNaam = new DataColumn("Naam");
dt.Columns.Add(dcId);
dt.Columns.Add(dcNaam);
DataColumn dcSubId = new DataColumn("SubId");
DataColumn dcSubNaam = new DataColumn("SubNaam");
dt.Columns.Add(dcSubId);
dt.Columns.Add(dcSubNaam);
Outlook.Application oApp = new Outlook.Application();
Outlook.NameSpace oNS = oApp.GetNamespace("mapi");
oNS.Logon(Missing.Value, Missing.Value, false, true);
Outlook.Folders oFolders = oNS.Folders;
foreach (Outlook.Folder oFolder in oFolders)
{
Outlook.Folders oSubFolders = oFolder.Folders;
foreach (Outlook.Folder oSubFolder in oSubFolders)
{
dt.Rows.Add(new object[] { oFolder.EntryID, oFolder.Name, oSubFolder.EntryID, oSubFolder.Name });
}
}
oNS.Logoff();
oNS = null;
oApp = null;
When i turn off MDI and load the forms to a panel, the outlook code loads fast again.
If i use a normal VS windows MDI form the code also loads fast...
I also noticed that the rest of my application works much faster with MDI turned off.
So there has to be an issue with office2010form MDI mode.