skyfox
New Member
- Outlook version
- Outlook 2010 64 bit
- Email Account
- Exchange Server
I am stuck again at what should be a simple if not a trivial task. I cannot seem to find a way to get this done or find the proper syntax to use to get it done. Adding folders to a PST file that is.
I have managed to create a PST file via VBA code based on some examples that I came across. (VBA code running within Outlook 2010)
Dim nSpace As Outlook.NameSpace
Dim pstFolder As Outlook.MAPIFolder
nSpace.AddStoreEx "C:\" & nSpace.CurrentUser & "\My Storage.pst", olStoreUnicode
Set pstFolder = nSpace.Folders.GetLast
pstFolder.Name = "My Storage" ' Sets Displayed Name
set pstFolder = Nothing
set nSpace = Nothing
So now that I have the "My Storage" PST file created, what is the proper syntax to create additional folders inside of this PST file with VBA? Majority the examples seems to be for creating folders inside the "DEFAULT" email folders and none of those methods that were adopted from those seem to work for PST files.
This email account is strictly for archiving all emails that is being sent to it. (receive only account) None of the other features of Outlook (Calendar, Contacts, Notes, etc.etc. are not used and never will be. What I need to do is filter out the inbox items and then send them to their applicable (yet to be created) folders inside this single PST file. I have sorted out the filtering 0f incoming mail. Based on this filtering, I have a routine that will generate new folder names from a collection. All I need is the simplest way to create new folders inside this PST file.
Thanks for any and all help.
Best Regards!
I have managed to create a PST file via VBA code based on some examples that I came across. (VBA code running within Outlook 2010)
Dim nSpace As Outlook.NameSpace
Dim pstFolder As Outlook.MAPIFolder
nSpace.AddStoreEx "C:\" & nSpace.CurrentUser & "\My Storage.pst", olStoreUnicode
Set pstFolder = nSpace.Folders.GetLast
pstFolder.Name = "My Storage" ' Sets Displayed Name
set pstFolder = Nothing
set nSpace = Nothing
So now that I have the "My Storage" PST file created, what is the proper syntax to create additional folders inside of this PST file with VBA? Majority the examples seems to be for creating folders inside the "DEFAULT" email folders and none of those methods that were adopted from those seem to work for PST files.
This email account is strictly for archiving all emails that is being sent to it. (receive only account) None of the other features of Outlook (Calendar, Contacts, Notes, etc.etc. are not used and never will be. What I need to do is filter out the inbox items and then send them to their applicable (yet to be created) folders inside this single PST file. I have sorted out the filtering 0f incoming mail. Based on this filtering, I have a routine that will generate new folder names from a collection. All I need is the simplest way to create new folders inside this PST file.
Thanks for any and all help.
Best Regards!