I am using Jacob jar file to save msg. To connect the pst i am using the below code:
ActiveXComponent ol = new ActiveXComponent("Outlook.Application");
if (ol != null) {
try {
System.out.println("try block....");
Dispatch olo = ol.getObject();
Dispatch myNamespace = Dispatch.call(olo, "GetNamespace","MAPI").toDispatch();
Variant varNewStore = Dispatch.call(myNamespace, "AddStore",strPSTPath);
Dispatch disAllFolders = Dispatch.call(myNamespace, "Folders").toDispatch();
Dispatch oRootFolder = Dispatch.call(disAllFolders, "GetLast").toDispatch();
Dispatch innerFolder = Dispatch.call(oRootFolder, "Folders","Inbox").toDispatch();
Dispatch items = Dispatch.call(innerFolder, "Items").toDispatch()
}
}
Now i want to delete or disconnect PST file from Outlook plz suggest me how can i achieve this functionality.
Regards, Kashif