A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Add-in to Read from Public Folder



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 28th 09, 03:59 AM posted to microsoft.public.outlook.program_addins
Chris McHenry
external usenet poster
 
Posts: 1
Default Add-in to Read from Public Folder

I have an C# VSTO add-in (running on both OL 2003 and OL 2007 clients) that is reading a large number of items from a public folder on startup. To improve performance, I moved this operation to a background thread. This seems to be working on a large set of my user population, but there is one user where it is causing Outlook to intermittently hang on startup. This user has OL2003 SP3. The Outlook client hangs when updating the folders and downloading data leading me to think that its something to do with cache mode.

I've read several posts that say not to use the OOM on a background thread. However, for my add-in to load in a reasonable amount of time I see few other alternatives for my architecture. I also saw some talk on this forum about marshalling data between the background and foreground threads, but the slowness I'm experiencing is reading the data using the OOM. Putting that on the foreground thread would frustrate my users to no end. One idea I had is to move this operation "out of process" by running another executable from my add-in or installing a service with my addin that does this work. I suppose this could create additional conflicts in the OOM?

I was using Outlook Redemption RDO objects to do this work, but found that due to the public folder architecture at my client, Redemption was not properly reading and authenticating to the public folder server for users who didn't have a public folder store on the same server as their mail store. I tried to troubleshoot with the Exchange admin, but found that nothing we did would make it work. Switching to the OOM worked, now I have this strange, one-off problem.

Here is the thread start block of code:

initThread = new Thread(CompleteInit);
initThread.Priority = ThreadPriority.Lowest;
initThread.IsBackground = true;
initThread.Start();

Here is the method called from CompleteInit where the code seems to hang:

public DataTable LoadDataTableFromConfig(string tableName)
{
ErrorLog.WriteLog(null, "ExchangeServer", "LoadDataTableFromConfig: Begin");
DataTable lDtResult = null;
try
{
ErrorLog.WriteLog(null, "ExchangeServer", "LoadDataTableFromConfig: Loading Public Folder: " + tableName);

if (tableName == "tblFileplanConfig")
return GetFilePlan();

lDtResult = SelectDatastructure(tableName);

OOMFolder folder = GetPublicFolder(@"ControlCenter\" + tableName);
if (folder != null)
{
ErrorLog.WriteLog(null, "ExchangeServer",
"LoadDataTableFromConfig: Found Public Folder - " + folder.FullFolderPath);

Items mailItems = folder.Items;
foreach (MailItem item in mailItems)
{
ErrorLog.WriteLog(null, "ExchangeServer", "GetFilePlan(): bailOut: " + bailOut);
if (bailOut)
return null;

ErrorLog.WriteLog(null, "ExchangeServer", "LoadDataTableFromConfig: Reading item");
if (item != null)
{
//string comment = (string)GetPropertyHelper(item, "comment");
SafeMailItem safeMailItem = new SafeMailItem();
safeMailItem.Item = item;
const int prComment = 0x3004001E;
string comment = (string)safeMailItem.get_Fields(prComment);
ErrorLog.WriteLog(null, "ExchangeServer", "LoadDataTableFromConfig - Found item:" + comment);
string[] dataElements = comment.Split(new char[] { '|' });

DataRow dr = lDtResult.NewRow();
for (int i = 0; i lDtResult.Columns.Count; i++)
{
try
{
dr[i] = GetValueFromArray(dataElements, lDtResult.Columns[i].ColumnName);
}
catch (Exception ex)
{
ErrorLog.WriteLog(ex, "ExchangeServer", "GetProperties:");
}
}
lDtResult.Rows.Add(dr);

}
}

}
}
catch (Exception ex)
{
ErrorLog.WriteLog(ex, "ExchangeServer", "LoadDataTableFromConfig:");
throw;
}

ErrorLog.WriteLog(null, "ExchangeServer", "LoadDataTableFromConfig: Complete");
return lDtResult;
}



Does anyone have any ideas for me as to how to work around this limitation of Outlook?

EggHeadCafe - Software Developer Portal of Choice
FLASH: Fix for Windows Vista
http://www.eggheadcafe.com/tutorials...indows-vi.aspx
Ads
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel vba macro to read Public folder in Outlook steve62 Outlook - General Queries 3 September 17th 09 04:32 PM
public folder contact read only wilecoyote Outlook - General Queries 0 January 17th 07 06:30 PM
How to read Item from Public Folder and process it DIRECTLY. gata Outlook - General Queries 4 July 7th 06 07:15 AM
Can't read text in Public Folder Calendar appointments Tim Munro Outlook - Calandaring 0 June 7th 06 09:41 PM
Read public folder via IMAP [email protected] Outlook - General Queries 1 April 24th 06 10:44 AM


All times are GMT +1. The time now is 12:54 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.