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

Is there a RefreshNow action for Search Folder?



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 19th 10, 06:55 AM posted to microsoft.public.outlook.program_addins
Mark B[_2_]
external usenet poster
 
Posts: 93
Default Is there a RefreshNow action for Search Folder?

VSTO, C#, OL2007

I need to refresh a search folder on Outlook Open since the DASL criteria
has a %Today function which works OK on the day the item first appears in
the folder but doesn't work the following day when I open up Outlook.

I have just changed the folder's refresh rate to 5 minutes but this still
means the user may get the wrong results when they first open Outlook in the
morning -- unless they presumably wait 5 minutes.

I saw that the folder object has a Refresh rate property but could find a
Refresh method to call.

Ads
  #2  
Old February 19th 10, 03:38 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?

I'm not sure where you're changing the search folder refresh rate, but
there's no such method in the Outlook object model. In fact, using the OOM
there isn't much you can do other than delete the existing search folder and
create a new one on each Outlook startup. Other than setting a search folder
using the Search object and saving the search to create a search folder
there isn't much to work with for you. You can get the existing search
folder, delete it and create a new one.

The Redemption (www.dimastr.com/redemption) object model has an
RDOSearchFolder object where you can call Stop() and Start() methods that
effectively force a refresh, but not in the Outlook object model.

--
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
...
VSTO, C#, OL2007

I need to refresh a search folder on Outlook Open since the DASL criteria
has a %Today function which works OK on the day the item first appears in
the folder but doesn't work the following day when I open up Outlook.

I have just changed the folder's refresh rate to 5 minutes but this still
means the user may get the wrong results when they first open Outlook in
the morning -- unless they presumably wait 5 minutes.

I saw that the folder object has a Refresh rate property but could find a
Refresh method to call.


  #3  
Old February 19th 10, 08:52 PM posted to microsoft.public.outlook.program_addins
Mark B[_2_]
external usenet poster
 
Posts: 93
Default Is there a RefreshNow action for Search Folder?

Yes I see now. The Refresh rate method was created by another programmer
here. It simply deleted the folder and recreated it again.


"Ken Slovak - [MVP - Outlook]" wrote in message
...
I'm not sure where you're changing the search folder refresh rate, but
there's no such method in the Outlook object model. In fact, using the OOM
there isn't much you can do other than delete the existing search folder
and create a new one on each Outlook startup. Other than setting a search
folder using the Search object and saving the search to create a search
folder there isn't much to work with for you. You can get the existing
search folder, delete it and create a new one.

The Redemption (www.dimastr.com/redemption) object model has an
RDOSearchFolder object where you can call Stop() and Start() methods that
effectively force a refresh, but not in the Outlook object model.

--
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
...
VSTO, C#, OL2007

I need to refresh a search folder on Outlook Open since the DASL criteria
has a %Today function which works OK on the day the item first appears in
the folder but doesn't work the following day when I open up Outlook.

I have just changed the folder's refresh rate to 5 minutes but this still
means the user may get the wrong results when they first open Outlook in
the morning -- unless they presumably wait 5 minutes.

I saw that the folder object has a Refresh rate property but could find a
Refresh method to call.



  #4  
Old February 19th 10, 09:17 PM posted to microsoft.public.outlook.program_addins
Mark B[_2_]
external usenet poster
 
Posts: 93
Default Is there a RefreshNow action for Search Folder?

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)
{
}
}
}















"Ken Slovak - [MVP - Outlook]" wrote in message
...
I'm not sure where you're changing the search folder refresh rate, but
there's no such method in the Outlook object model. In fact, using the OOM
there isn't much you can do other than delete the existing search folder
and create a new one on each Outlook startup. Other than setting a search
folder using the Search object and saving the search to create a search
folder there isn't much to work with for you. You can get the existing
search folder, delete it and create a new one.

The Redemption (www.dimastr.com/redemption) object model has an
RDOSearchFolder object where you can call Stop() and Start() methods that
effectively force a refresh, but not in the Outlook object model.

--
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
...
VSTO, C#, OL2007

I need to refresh a search folder on Outlook Open since the DASL criteria
has a %Today function which works OK on the day the item first appears in
the folder but doesn't work the following day when I open up Outlook.

I have just changed the folder's refresh rate to 5 minutes but this still
means the user may get the wrong results when they first open Outlook in
the morning -- unless they presumably wait 5 minutes.

I saw that the folder object has a Refresh rate property but could find a
Refresh method to call.



  #5  
Old February 20th 10, 12:16 AM 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)
{
}
}
}


  #6  
Old February 22nd 10, 10:36 AM posted to microsoft.public.outlook.program_addins
Mark B[_2_]
external usenet poster
 
Posts: 93
Default Is there a RefreshNow action for Search Folder?

Thanks.

After I had been using Outlook all day, opening and closing it about 5 times
during the day, all folders suddenly appeared italicized.

Then when I clicked on any of them, the following message was displayed:

"Cannot display the folder. Microsoft Office Outlook cannot access the
specified folder location. The operation cannot be performed because the
object has been deleted."

My startup code does delete all folders and recreates them but generally
there have been no issues. Do you know what might be causing the message?
Note after I just restarted Outlook now, the folders were non-italicized and
displayed the correct results. I wouldn't want a user to have to do that
everyday though.





"Ken Slovak - [MVP - Outlook]" wrote in message
...
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)
{
}
}
}



  #7  
Old February 22nd 10, 02:55 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?

The cause of the message is pretty obvious from the message itself, no?

--
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
...
Thanks.

After I had been using Outlook all day, opening and closing it about 5
times during the day, all folders suddenly appeared italicized.

Then when I clicked on any of them, the following message was displayed:

"Cannot display the folder. Microsoft Office Outlook cannot access the
specified folder location. The operation cannot be performed because the
object has been deleted."

My startup code does delete all folders and recreates them but generally
there have been no issues. Do you know what might be causing the message?
Note after I just restarted Outlook now, the folders were non-italicized
and displayed the correct results. I wouldn't want a user to have to do
that everyday though.


  #8  
Old February 23rd 10, 10:41 PM posted to microsoft.public.outlook.program_addins
Mark B[_2_]
external usenet poster
 
Posts: 93
Default Is there a RefreshNow action for Search Folder?

I would think not because if the folder was deleted why would it still
appear in the list of folders (albeit italicized)? The message appears to
the right where list of search results normally appears.

"Ken Slovak - [MVP - Outlook]" wrote in message
...
The cause of the message is pretty obvious from the message itself, no?

--
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
...
Thanks.

After I had been using Outlook all day, opening and closing it about 5
times during the day, all folders suddenly appeared italicized.

Then when I clicked on any of them, the following message was displayed:

"Cannot display the folder. Microsoft Office Outlook cannot access the
specified folder location. The operation cannot be performed because the
object has been deleted."

My startup code does delete all folders and recreates them but generally
there have been no issues. Do you know what might be causing the message?
Note after I just restarted Outlook now, the folders were non-italicized
and displayed the correct results. I wouldn't want a user to have to do
that everyday though.



  #9  
Old February 24th 10, 12:10 AM 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?

Was it actually deleted? Did you get the long-term EntryID (from MAPI) or
the EntryID from Outlook and save it to get the folder again? If it was
actually deleted then the folder list was corrupted.

Start Outlook using the /resetnavpane startup switch, which will reset the
navigation pane to the default if you suspect corruption in the view.

--
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
...
I would think not because if the folder was deleted why would it still
appear in the list of folders (albeit italicized)? The message appears to
the right where list of search results normally appears.


 




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
triggering the "post reply to folder" action [email protected] Outlook and VBA 2 March 8th 09 12:25 AM
action requests result in a popup menu with no action Gray Fox IA Outlook - Installation 0 September 29th 08 05:48 AM
OL2007 Folder search similar to Vista Start Menu search? Dan Outlook - General Queries 7 January 25th 08 02:42 PM
Action with form in public folder Gil Outlook and VBA 2 May 3rd 07 03:37 PM
Create a search folder to look at all emails in one folder and selected criteria in other folders [email protected] Outlook - General Queries 1 April 10th 06 10:40 AM


All times are GMT +1. The time now is 11:50 AM.


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.