J
Juuso
Hi,
I'm using VS2008 & Outlook 2007. My application tries to watch Outlook
folders, their additions, renames, moves and deletions.
I have a wrapper class for a folder that has class level variables for
folder (Outlook.Folder) and it's subfolders (Outlook.Folders). When this
class is initialized, these variables are set and events attached (see below
my code). In ThisAddin_Startup "watched" folder and it's subfolders are
iterated, wrapper classes created and added to a class level hashtable.
The problem is, BeforeFolderMove for a folder in my wrapper class fires only
occasionally, but folder addition and change always do. This shouldn't be a
scope issue, as the two other events do fire. Or what's happening?
Thanks for any help.
....
private Outlook.Folders _folders;
private Outlook.Folder _folder;
public DFolder(Outlook.MAPIFolder folder)
{
// Set folder variables
_folder = folder as Outlook.Folder;
_folders = folder.Folders;
// Setup events
_folder.BeforeFolderMove += new
Outlook.MAPIFolderEvents_12_BeforeFolderMoveEventHandler(folder_BeforeFolderMove);
_folders.FolderChange += new
Outlook.FoldersEvents_FolderChangeEventHandler(folder_FolderChange);
_folders.FolderAdd += new
Outlook.FoldersEvents_FolderAddEventHandler(folder_FolderAdd);
}
I'm using VS2008 & Outlook 2007. My application tries to watch Outlook
folders, their additions, renames, moves and deletions.
I have a wrapper class for a folder that has class level variables for
folder (Outlook.Folder) and it's subfolders (Outlook.Folders). When this
class is initialized, these variables are set and events attached (see below
my code). In ThisAddin_Startup "watched" folder and it's subfolders are
iterated, wrapper classes created and added to a class level hashtable.
The problem is, BeforeFolderMove for a folder in my wrapper class fires only
occasionally, but folder addition and change always do. This shouldn't be a
scope issue, as the two other events do fire. Or what's happening?
Thanks for any help.
....
private Outlook.Folders _folders;
private Outlook.Folder _folder;
public DFolder(Outlook.MAPIFolder folder)
{
// Set folder variables
_folder = folder as Outlook.Folder;
_folders = folder.Folders;
// Setup events
_folder.BeforeFolderMove += new
Outlook.MAPIFolderEvents_12_BeforeFolderMoveEventHandler(folder_BeforeFolderMove);
_folders.FolderChange += new
Outlook.FoldersEvents_FolderChangeEventHandler(folder_FolderChange);
_folders.FolderAdd += new
Outlook.FoldersEvents_FolderAddEventHandler(folder_FolderAdd);
}