![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
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 |