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

Refresh Calendar Folder List After Create New Folder



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old November 22nd 08, 11:19 PM posted to microsoft.public.outlook.program_addins
TerryAtGmail
external usenet poster
 
Posts: 1
Default Refresh Calendar Folder List After Create New Folder

I'm using Outlook 2003 and I have a background process that adds new
subfolders to the root calendar folder (GetDefaultFolder(olFolderCalendar))
using the Outlook C++ COM interface.

When I start Outlook and am sitting in the mail view, the background process
adds 1 or more subfolders to the root calendar folder. When I switch to the
calendar view the new folders aren't displayed. If I restart Outlook or do
something to display the list of all folders the list refreshes and the
folders I added are displayed.

When I start Outlook and have the calendar view selected when the background
process adds 1 or more subfolders to the root calendar folder, the folders
show up as they are added.

Is there a way to invalidate the list of folders or refresh the list of
folders so that my new folders will be display in the first case?

The background process gets an Outlook instance like this:

CLSID clsidOutlook;CLSIDFromProgID(L"Outlook.Application ", &clsidOutlook);

HRESULT hr = CoCreateInstance(clsidOutlook, NULL, CLSCTX_LOCAL_SERVER,
IID_IDispatch,(void **)&pOutlookPtr);

Gets the MAPI namespace like this:

CComQIPtr Outlook::_Application pApplication(pOutlookPtr);
CComQIPtr Outlook::_NameSpace
pNamespace(pApplication-GetNamespace(L"MAPI"));

And gets the rool calendar folder like this:

CComQIPtr Outlook::MAPIFolder
pRootCal(pNamespace-GetDefaultFolder(olFolderCalendar));

I do not log into Outlook:
// hr = pNamespace-Logon(vEmpty, vEmpty, vEmpty, vEmpty);

But this doesn't make a difference if I do.
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
Macro for refresh folder [email protected] Outlook - General Queries 0 October 25th 06 05:49 AM
create folder in a shared contacts list Bob Aylward Outlook - Using Contacts 1 October 10th 06 12:25 PM
can't create a distribution list cuz contacts folder can't be foun windows314 Outlook - Using Contacts 7 September 3rd 06 07:01 PM
Calendar folder missing from folder list in outlook 2003 Bill B Outlook - Calandaring 11 July 7th 06 04:44 PM


All times are GMT +1. The time now is 09:09 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.