/**
* Script: getChildFolderNames.js
* Purpose: Opens the Inbox for the Outlook profile defined
* and displays all the child folders to the user.
*
* Author: Daren Thiel
* Date: 24 November 1998
*
* Note: If the message are large the WScript.Echo box will
* be larger than the screen area. By default the OK
* button is selected, so pressing enter will clear the
* popup from view. Recommend using cscript to execute.
* Web: http://www.winscripter.com
**/
/* Set the name of the profile to use */
var profile = "Microsoft Outlook Internet Settings";
/* Create a MAPI Session Object */
omapi = new ActiveXObject( "MAPI.Session" );
/* Open the profile of where we want to store the address */
omapi.Logon( profile );
/* Create an object for the Inbox of this profile */
objFolder = omapi.Inbox;
function ListFolders( objParent, fIndex )
{
var name = "";
name = objParent.Item(fIndex).Name;
return name;
}
objFold = objFolder.Folders;
mCount = objFold.Count;
WScript.Echo( mCount );
name = "";
for ( i = 1; i < mCount + 1; i++ )
{
name += "Inbox\\" + ListFolders( objFold, i ) + "\n";
}
WScript.Echo( name );