Ok, got something cooking. Could be a bit nicer maybe and may need some tweaking but for now it works. I got two other UDF's cooking at the same time that are sort of related so I'll wait with posting the final versions until all three of them are ready and fully tested.

 Code:
Break On

$FolderID = 6
$Target = "Suspected Spam"

$test = GetSubfolders($FolderID, $target)

? $test[0]
? $test[1]
? $test[2]


Sleep 5
	
Function GetSubfolders($FolderID, $target)
	Dim $MyArray[2]
	$outlook = CreateObject("Outlook.Application")
	$namespace = $outlook.GetNamespace("MAPI")
	$folder = $namespace.GetDefaultFolder($folderID)
	
	$colFolders = $Folder.Folders
	For Each $objFolder in $colFolders
		$objSubfolder = $Folder.Folders($objFolder.Name)
		If $objSubfolder = $target
			$MyArray[0] = $objFolder.Name
			$colItems = $objFolder.Items
			$MyArray[1] = $colItems.Count
			For Each $objItem in $objFolder.Items
				$intSize = CInt($intSize) + $objItem.Size
			Next
			$MyArray[2] = CInt($intSize) /1024
		EndIf
	Next
				
	$GetSubfolders = $MyArray
EndFunction
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.