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

Question about multiple instances of a MapiFolder object



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 25th 08, 03:01 PM posted to microsoft.public.outlook.program_addins
[email protected]
external usenet poster
 
Posts: 3
Default Question about multiple instances of a MapiFolder object


I have designed a MapiFolder/Folders collection wrapper class to
detect any changes in the folder structure of outlook.

Now, when I rename a folder the FolderChange event fires, sending a
MapiFolder object which has got the already new folder name. So far so
good. But inside my wrapper class there still exists a MapiFolder
object belonging to the same folder. Querying the folder name of this
object retrieves the previous name of the folder!

Is that a normal behaviour? Why doesn't the name get updated? And: Is
it still possible to use the old MapiFolder object or is not only
"outdated" in respect of the name?
Ads
  #2  
Old March 25th 08, 03:44 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Question about multiple instances of a MapiFolder object

In cases like that you are probably best off resetting the MAPIFolder object
in your wrapper class to reflect the new item. You don't want to be holding
outdated references. You can add a public property to your wrapper class,
say called Folder and set that to the updated MAPIFolder object.

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


wrote in message
...

I have designed a MapiFolder/Folders collection wrapper class to
detect any changes in the folder structure of outlook.

Now, when I rename a folder the FolderChange event fires, sending a
MapiFolder object which has got the already new folder name. So far so
good. But inside my wrapper class there still exists a MapiFolder
object belonging to the same folder. Querying the folder name of this
object retrieves the previous name of the folder!

Is that a normal behaviour? Why doesn't the name get updated? And: Is
it still possible to use the old MapiFolder object or is not only
"outdated" in respect of the name?


  #3  
Old March 25th 08, 04:28 PM posted to microsoft.public.outlook.program_addins
[email protected]
external usenet poster
 
Posts: 3
Default Question about multiple instances of a MapiFolder object


In cases like that you are probably best off resetting the MAPIFolder object
in your wrapper class to reflect the new item. You don't want to be holding
outdated references. You can add a public property to your wrapper class,
say called Folder and set that to the updated MAPIFolder object.


Thanks for answering. I did as you said. But I simply was wondering
about the general approach behind that. If the wrapper class didn't
check on the FolderChange event it would never be informed about the
name change. I am quite a COM beginner and I thought the whole AddRef/
Release stuff had been devised to avoid things like that. Now I know
better.
 




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
Why don't I need a MapiFolder object? Carol G Outlook and VBA 5 January 17th 07 05:38 AM
Multiple Instances of Outlook John Mann Outlook and VBA 1 December 8th 06 05:09 PM
Closing Multiple Instances bobdydd Outlook - General Queries 3 May 22nd 06 12:56 AM
Multiple instances of Outlook DS-NTE Outlook - General Queries 1 February 22nd 06 11:51 AM
Multiple Instances. Mister Q Outlook - Installation 1 January 10th 06 10:59 PM


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