View Single Post
  #5  
Old February 19th 10, 11:16 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Is there a RefreshNow action for Search Folder?

Italicized/dimmed means the search folder hasn't been accessed in xx days
and has gone inactive. Touching it will force a rescan, as when you click in
it. Bolded with a number in square brackets indicates the number of unread
items.

This is all basic search folder UI, nothing special and nothing due to code.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Mark B" wrote in message
...
Now I recreate the folders on Startup.

I have noticed some weird behavior though. Sometimes the folder titles
appear italicized and the folder icon dimmed. Then when I click on one the
titles appear normal again and I can see the search results in the
particular folder. The issue though is that the folder title no longer has
the number of items in the title, e.g. "My Search [23]". It appears as "My
Search". I set this property after I create the folder:

public void ReCreateAll()
{
foreach (SearchFolder f in sFolders.Values)
f.Create();
}

public void Create()
{
try
{
Outlook.Application olApp;
Outlook.Search search;

//Deleting existing search-folder
Remove();

//Initialization
olApp = Globals.ThisAddIn.Application;
search = olApp.AdvancedSearch(this.scopeStr, this.filter,
true, this.tag);

Outlook.MAPIFolder myFolder = search.Save(this.FolderName);
this.EntryId = myFolder.EntryID;
myFolder.ShowItemCount =
Microsoft.Office.Interop.Outlook.OlShowItemCount.o lShowTotalItemCount;
Globals.ThisAddIn.SaveSearchFoldersInfo();

}
catch (Exception e)
{
AppLogger.LogException(e);
}
}



public void Remove()
{
if (this.folderEntryId != null)
{

Outlook.Application olApp;
olApp = Globals.ThisAddIn.Application;

try
{
Outlook.MAPIFolder existingFolder =
olApp.GetNamespace("MAPI").GetFolderFromID(this.fo lderEntryId,
Type.Missing);

if (existingFolder != null)
existingFolder.Delete();

//Remove folder's entryID
this.folderEntryId = null;

//Save the changes
Globals.ThisAddIn.SaveSearchFoldersInfo();
}
catch (Exception)
{
}
}
}


Ads