Login | |
|
 |
RE: Subfolder in Outlook... - 8/14/2008 12:38:44 AM
|
|
 |
|
| |
Rischip
Posts: 502
Score: 2
Joined: 3/26/2007
Status: offline
|
Basically in this code you SET the object reference "Namespace" to the folder name at the level which you want to modify. Set objMailbox = objNamespace.Folders(strTopLevelFolderName) ' In the code this is the MAIN MAILBOX level Set objNewFolder = objMailbox.Folders.Add(newFolderName) 'We add a folder under MAIN MAILBOX with the name in the variable newFolderName Set objNewSubFolderNS = objMailbox.Folders(newFolderName) 'Then we set our "NameSpace" to the level of the folder we just created Set objNewSubFolder = objNewSubFolderNS.Folders.Add(newSubFolderName) 'At the "newFolderName" Level, we can add another sub folder and so on..... Set NameSpace (foldername) then Folders.Add
_____________________________
Rischip Author of - The Grim Linker
|
|
| |
|
|
|
 |
RE: Subfolder in Outlook... - 8/18/2008 1:24:34 AM
|
|
 |
|
| |
Rischip
Posts: 502
Score: 2
Joined: 3/26/2007
Status: offline
|
Which part are you having trouble with... This was example code based on your request, and it does work for me. What is your configuration? quote:
I am having the toughest time trying to create a subfolder that is NOT a subfolder of the Inbox folder. The microsoft website http://www.microsoft.com/technet/scriptcenter/resources/qanda/sept07/hey0926.mspx describes how to create a subfolder to Inbox AND a folder on the same level of Inbox, but not a subfolder of a different folder other than the Inbox folder. The code I provided does that. I also explained that in order to create a subfolder that you need to set the namespace to the folder where you want to create the sub, then use the .Folders.Add method. Which part do you not understand?
< Message edited by Rischip -- 8/18/2008 2:35:54 AM >
_____________________________
Rischip Author of - The Grim Linker
|
|
| |
|
|
|
| |
|
|
 |
|
 |
|
|