Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Grab Outlook Contacts with ScriptMaster

Featured Replies

Requirements:

ScriptMaster for FMP (AWESOME!)

Install Groovy and Reboot (yes you have to reboot, the ActiveXProxy won't work without it)

(During setup ActiveXProxy is an option, make sure it installs with Groovy.)

Recommended:

Install Advanced Security for Outlook

Should be in a startup script: (if this runs more than once, it stops working!)


SMLoadJar ( "file://C:/Program Files/Groovy/lib/scriptom-1.2.jar" ) & 

SMLoadJar ( "file://C:/Program Files/Groovy/lib/jacob.jar" )





Returns the Number of Contacts, followed by the Type and Name of each Item:



EvaluateGroovy ( "

		import org.codehaus.groovy.scriptom.ActiveXProxy;

	

	// Create the Outlook Object

	def oOutlook = new ActiveXProxy("Outlook.Application");

	

	//Logon to MAPI

	def oMAPI = oOutlook.GetNamespace("MAPI");

	oMAPI.Logon "Outlook";

	

	//Create the Contact Items Object

	def oContacts = oMAPI.GetDefaultFolder(10).Items;

	

	//Get the Number of Contact Items

	NumContacts = oContacts.Count.value;



	res = NumContacts + " Contacts Found";



	//Loop through the Contact Items

	for (i in 1..NumContacts) {

		//Create the Contact Object

		def oContact = oContacts.Item(i);

		

		//Get the MessageClass of the Item

		def msgclass = oContact.MessageClass.value;

		

		if (msgclass == "IPM.Contact") {		//If it is a Contact, do this

			res = res + "n" + msgclass + "tt" + oContact.FullName.value;

		} else if (msgclass == "IPM.DistList") {	//If if is a Distribution List, do this

			res = res + "n" + msgclass + "t>>>t" + oContact.DLName.value;

		} else {					//Otherwise, do this

			res = res + "n" + msgclass + "ttCANNOT HANDLE THIS CLASS";

		}

	}

	

	//Return the results we've gathered

	return res;

" )

Notice:

When working with COM objects in Groovy you often have to use '.value' to get the value of a property. If you don't, the Object Handle can be passed rather that the data you are expecting.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.