Hi All,
New here and new to VBA programming. I'm hoping to get some assistance with the following:
I have a subfolder in my Outlook inbox (Inbox -> Directs). I would like to create an Excel file that I can enter employees names into Column A. Once the names are entered I want to be able to run a Macro that will automatically create subfolders in the "Directs" folder. The subfolders should be titled the name of the employee. (Inbox -> Directs -> JohnDoe).
I would like for the file to be dynamic, meaning if the entire list of employees change, I would like the entire list of subfolders to change to reflect that. Also, the excel file will have a heading to the column ("employees") or something to the sort. So the names of the employee will not start until row 2.
I'm using Office 2010. I hope this is enough information. Thanks in advance for any help you can provide!
sub snb on error resume next sn=sheets(1).cells(1).currentregion with createobject("outlook.Application").GetnameSpace("MAPI").getdefaultfolder(6).folders("direct") for j=2 to ubound(sn) .folders.add sn(j,1) next end with End Sub
Last edited by snb; 10-17-2011 at 10:40 AM.
Hi Snb,
Thanks for the code.
When I open the editor, I am creating a new module off of sheet 1. Then pasting the code into the module. I am then assigning the Macro to a button. However, whenever I hit the button nothing happens. I have "employee" in A1 of my sheet and employee names from A2:A10.
Any ideas?
I'm sorry but again I am not very familiar with VBA so I am having a hard time troubleshooting.
See the attachment.
Check the existence of subfolder 'direct' in the PostIN-folder
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks