#  Other Applications & Softwares  > Outlook Formatting & Functions >  >  outlook functions

## martindwilson

oh great, now we're into outlook in its many guises. i foresee many hours being spent trying to explain things, bring it on! now a few more hours of my life can be usefully employed.  :Smilie:  :Smilie:  :Smilie:  :Smilie:  :Smilie:  :Smilie:  :Smilie:  :Smilie:  :Smilie:

----------


## stevesunfold

hey martin if youre a wiz  :Wink: 
id like to be able to add a 100 folders into a specific folder that will be begin
j5800 through to j5899 
can u help?

----------


## martindwilson

no!  :Smilie:  :Smilie:  :Smilie:  :Smilie:  :Smilie:  :Smilie:  :Smilie:  :Smilie:  :Smilie:  i hate outlook!
especialy users and permissions

----------


## DonkeyOte

```
Please Login or Register  to view this content.
```


Change code in RED to be the parent folder in which the new folders are to be added.

----------


## stevesunfold

thanks donkeyote
im not sure if im doing this right
in my inbox
i have a folder called J5800
i then went to tools > macro and created the macro you kindly supplied
i then ran the macro but i got this message
run time error 2147221233 (8004010f)':
the operation failed. an object could not be found
and highlights this code 
Set OL_FL = OL_NS.Folders("Personal Folders").Folders("J5800")

im guessing im doing somethng wrong rther than your code
and would appreciate if you could point me the right way

regards

----------


## DonkeyOte

Confused... I thought per your OP you were adding 100 folders namely J5800 to J5899 to a given folder in your mailbox... whereas your latest post implies folder J5800 already exists -- are you able to clarify the "tree" structure you're attempting to create ?

----------


## stevesunfold

hi donkey 
this is weird because i have now gone to it and they are there
i then went to try and add from 5900 and they went in ok
except 5901 is missing
my tree is just inbox
although i would like it to be 
inbox > j5800 > then the 100 folders
inbox > j5900 > then the 100 folders
thanks for your help
this is the code i have 



```
Please Login or Register  to view this content.
```


im happy to put the initial folder in ie j5800 ( that holds all between 5800 and 5899 ) and then add the folder j5900 so that the next 100 go in that folder

im guessing that would change to line
Set OL_FL = OL_NS.Folders("Personal Folders").Folders("Inbox")
probably to somthing like 
Set OL_FL = OL_NS.Folders("Personal Folders").Folders("Inbox").Folders("j5900").
?
regards

----------


## DonkeyOte

Below is code that would iterate 5800 to 5900 and add xx01 to xx99 as sub folders thereof 
_(ie create 5800 then add 5801 to 5899 as subfolders, then create 5900 and create 5901 to 5999 as subfolders).
_



```
Please Login or Register  to view this content.
```

----------


## stevesunfold

donkeyote
thats amazing and works fine
thanks so much
regards

----------

