![]() |
|
|
|||||||
| Petri.co.il is happy to award auglan the title of Most Valuable Member !!! |
| Register | Calendar |
Search |
Today's Posts |
Mark Forums Read |
| Notices |
|
|
Script to select "Show this folder as an email address book"this thread has 0 replies and has been viewed 530 times
|
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||||||
|
||||||||
|
Hi,
I'm trying to get this cript to work to with Exchange 2010 server but it is not working for some reason. We have 20 distribution lists in our public folders. We have to right click on each and enabale "Show this folder as an email address book" for each user. Looks like this script might do the job but it is not running correctly. It fails on GetObject line Can someone help? Dim aFolders, fldr, i, j, objNS, FolderPath rootFolder = "Public Folders\All Public Folders\EMAIL DISTRIBUTION LISTS" Set objNS = GetObject("", "Outlook.Application").GetNamespace("MAPI") aFolders = Split(rootFolder, "\") On Error Resume Next Set fldr = objNS.Folders(aFolders(0)) If Err Then WScript.Quit For i = 1 To UBound(aFolders) Set fldr = fldr.Folders(aFolders(i)) If Err Then WScript.Quit Next On Error Goto 0 'here 'fldr' contains your starting 'rootFolder' object, now enum all subfolders in there: EnumSubFolders fldr 'call recursive function for this folder Set objNS = Nothing Function EnumSubFolders(tempfolder) 'folder types: 0 = mail; 1 = calendar; 2 = contacts; 3 = tasks; 4 = journal; 5 = notes If(tempFolder.DefaultItemType = 2) Then tempFolder.ShowAsOutlookAB = True 'mark current folder as mail address book End If If tempfolder.Folders.Count Then 'if there are several subfolders in here For j = 1 To tempfolder.Folders.Count EnumSubFolders tempfolder.Folders(j) 'call same function again for each subfolder Next End If End Function |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to Find average bandwidth using "show interface" command? | ingram | Cisco Routers & Switches How-to | 2 | 17th June 2011 22:39 |
| Is it possible to have some kind of "comment" or "description" for a folder? | alleycat7th | Windows Vista | 2 | 10th February 2009 13:00 |
| "Select a profile" popup doesn't displayed when outlook start | quentinc | Exchange 2007 / 2010 / 2013 | 3 | 25th September 2007 18:28 |
| 2 NICs how to select "primary" | gregaSLO | Windows Server 2000 / 2003 | 8 | 6th June 2007 00:01 |
| "Junk E-mail" folder under "Tasks" | sorinso | Outlook XP/2003/2007 | 0 | 15th December 2006 11:00 |