Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: CDO Collections
You'll need to visit the microsoft website and look for the CDO download for your OS if you don't have it already.
This checks the Personal Address Book on the PC, find which ones are Personal Distribution Lists and shows you who is on the list.
version = 5.5.2448.0
; setup the profile to logon to... strProfileInfo = strcat("user", @lf, "server") ; open the mapi session object and logon... objSession = Objectopen("MAPI.Session") objSession.Logon( , , @false, @false, , @True, strProfileInfo) ; set the personal address book object, and its entries... pab = objSession.AddressLists("Personal Address Book") pabEntries = pab.AddressEntries ; if you use the COUNT var it returns a HUGE number (this is MS standard! Heh!) message("Entry Count", pabEntries.count) ; lets do our own count... entrycount = 0 loopstart = 1 ; loop until no more objects in the collection... ;suppress the minor errors... errormode(@off) while @true entry = pabEntries.item(loopstart) if entry > 0 ; if entry == 0 then there's no object in the collection... ; since there is one increment... loopstart = loopstart + 1 else ; no more objects then leave the loop... break endif endwhile ; reset the errormode... errormode(@cancel) ;;objectclose(entry) ; one too many objects so decrement the count... entrycount = loopstart - 1 ; show how many entries in the PAB... message("Number of Entries", entrycount) ; now go into each entry and find the PERSONAL DISTRIBUTION LISTS... for y = 1 to entrycount entry = pabEntries.item(y) if entry > 0 if entry.type == "MAPIPDL" ; this means a PDL... ; show the entry's name... message("Entry", entry.name) ; now check to see how many members in this PDL... pdlentries = entry.members ; same looping strategy as above... subentrycount = 0 loopstart = 1 ;suppress the minor errors... errormode(@off) while @true subentry = pdlentries.item(loopstart) if subentry > 0 ; if no object leave the loop...otherwise increment... loopstart = loopstart + 1 else break endif endwhile ; reset the errormode... errormode(@cancel) ; decrement the counter by 1... subentrycount = loopstart - 1 ; show how many entries in the PDL... message("PDL Entries", subentrycount) ; now loop thru the PDL and show each entry's address... for z = 1 to subentrycount address = pdlentries.item(z) message("Address in PDL for...", address.name) next endif endif next ; cleanup and go home... objectclose(address) objectclose(entry) ;;objectclose(subentry) objectclose(pdlentries) objectclose(pab) objectclose(pabEntries) objectclose(objSession) exit
Article ID: W14664
Filename: CDO Collections and Personal Address Book.txt
File Created: 2000:10:10:10:34:36
Last Updated: 2000:10:10:10:34:36