Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Synchronization between IManage-API and MAPI when creating folders
BjoernWeber
Hi!
I want to move E-Mails from an Outlook-folder to a WorkSite-folder. Before I do that, I want to create the same subfolder-structure in the WorkSite-folder. For several reasons I want to use the MAPI to do the copying. So I have to use the MAPI-folder-handles of the parent- and the subfolders.
My problem is, that when I create a folder with the IManage-API like this
[C#]
using IManage;
using IMANEXTLib;
// destination is a valid IManFolder-object
IManDocumentFolders subFolders = (IManDocumentFolders)destination.SubFolders;
IManDocumentFolder newIManFolder = subFolders.AddNewDocumentFolder("testfolder", "description");
subFolders.Refresh();
newIManFolder.Refresh();
destination.Refresh();
the IManage-API 'sees' the newly created folder, but when I try to get an handle via the MAPI, the 'destination'-folder seems to have no subfolders:
[C#]
using Microsoft.Office.Interop.Outlook;
Application oApp = new Application();
_NameSpace oNameSpace= oApp.GetNamespace("MAPI");
oNameSpace.Logon(null,null,false,true);
MAPIFolder destinationMAPI = oApp.Session.Folders["MailSite"].Folders["Server"].Folders["WorkSite Explorer"].Folders["library"].Folders["My Workspaces"].Folders["testworkspace"].Folders["name of the destination-folder"];
// here the destinationMAPI.Folder.Count is 0
When I wait some time (between some seconds and several minutes) after creating the folder with the IManage-API and then try to access the folder and its subfolders via MAPI, there seem to be no problems, the folders are there.
What am I doing wrong?
Best regards,
Björn
Find more posts tagged with
Comments
jny
Try omitting all of your WorkSite Refresh calls. You should not have to call refresh when you're adding new server objects.
The refresh call is used to get the latest copy from the server. When you create a new object on the server-side, then call refresh, this might cause some time-delay as you're requesting the latest version that is currently on the server-side, but the new object you've just added has not been updated.
BjoernWeber
Omitting the WorkSite refresh calls doesn't work.
Still the same problem. The MAPI does not see the subfolders for some time. When I wait, they appear.