-
Add Com library Microsoft.Office.interop.outlook
-
Create object of COM Object MailItem,Namespace,Application
-
ns(object of namespace) = app(object of Applciation).GetNamespace("MAPI")
ns.AddStoreEx(newPstFileLocation, OlStoreType.olStoreUnicode)
-
For Each store As Store In ns.Session.StoresIf store.FilePath = newPstFileLocation ThennewPST = storeEnd IfNext
-
Object of MAPI Folder Ex: oFolder
-
oFolder = newPST.GetRootFolder
-
.mail = CType(ns.Session.OpenSharedItem(filetobeprocessed), MailItem)
mail.Move(folderInbox)
folderInbox is object of Simple inbox folder and we are adding moving files to folderInbox.
To Add physical MSG files to PST and generate PST we need to follow below steps:
Join the conversation! Your thoughts help the community grow.