Using the MicrosoftOutlook Connector

This example solution shows how to trigger automation actions based on a Microsoft Outlook email being replied to. The automation sections are shown below:

 

Flag Email

In this part of the automation, the triggering event is when the Reply button is clicked in Outlook. The email that is being replied to is retrieved and a proxy is generated for the email to access the individual properties of the email. The email To property is compared to a name string Andrea Ridgway. If the To property matches the set text string, a message displays informing the user to Copy Sales on all messages sent to A. Ridgway.

 

Copy Email to List Box

In this part of the automation, the triggering event is when the user clicks the Send button in Outlook. The SentOn date and Subject are retrieved from email proxy, concatenated in a StringExpression, and added to a list box. A method for clearing text from the list box is included.

 

How to create this solution

  1. Create a Windows form that contains a list box and a button. Name the button btnClear and set the button text to Clear.

  2. Add an automation to the solution.

  3. Add the MicrosoftOutlook component to the automation. It will display in the Component Tray.

  4. Set the Folder property for the MicrosoftOutlook component to a folder for which you want to monitor email replies. For example, to monitor the IT folder, which is a subfolder in the Inbox, you would enter Inbox\IT.

  5. Set the Monitor property for the MicrosoftOutlook component to True.

  6. Set the ReadType property for the MicrosoftOutlook component to All.

  7. Find the MailReplied event for the MicrosofOutlook component and add it to the automation.

  8. Click the arrows in the MailReplied design block to display the event's properties.

  9.  Right-click on the Mail output of the MailReplied event and select the Extract Proxy option.

A proxy object, microsoftOutlookMailProxy is created.

  1. Select the proxy object in Object Explorer and then view the available properties.

  2. Select the To property of the microsoftOutlookMailProxy and drag it to the automation.

  3. Add a string variable to the automation and set the text value to a the name of a person from whom you receive email. For more information, see String Variable.

  4. Add a Boolean expression to the automation and set the expression to a == b. Set the Identifiers for the expression to String type. Boolean Expression.

  5. Right-click on the Result data output of the Boolean Expression and select Make Decision. A Boolean Decision diamond is displayed on the automation.

  6. Add a MessageDialog component to the automation and set the Message. For more information, see MessageDialog.

  7. Connect the design blocks as shown in the Flag Email image shown above.

  8. Run the solution. It will take a few seconds for Studio to process the mail in the folder you selected. The more mail in the folder, the longer the processing time. Next, find an email from the person you identified in the string variable. Highlight the email and click the Reply button. A message should display as the email is opened for reply.

To complete the solution, perform the following steps.

  1. If the solution is running, stop it and return to the automation in Studio.

  2. Locate the MailSent event for the MicrosoftOutlook component and drag it to the automation.

  3. Locate the SentOn property for the microsoftOutlookMailProxy and drag it to the automation.

  4. Locate the Subject property for the microsoftOutlookMailProxy and drag it to the automation.

  5. Add a DateTimeUtils component to the solution and use the ToString method of the component. For more information, see DateTime Utils.

  6. Add a String Expression to the automation and set the Expression to a+" "+b. For more information, see String Expression.

  7. Use the Explore Component Properties view in Object Explorer for the list box.

  8. Select the Items property and then click the Configure Type button to explore all properties and methods for the Listbox.item.

  9. Locate the Add method and drag it to the automation.

  10. Locate the Clear method and drag it to the automation.

  11. Connect the design blocks as shown in the Copy Email to Listbox section above.

  12. Save and run the solution. After you select an email to reply to, enter your reply and click the Send button. The date time of the reply and the subject of the reply email will displays in the list box on the Windows form. You can remove the list box entry by clicking the Clear button.

 


Privacy | Trademarks | Terms of Use | Feedback

Updated: 18 June 2020

© 2016 - 2020 Pegasystems Inc.  Cambridge, MA All rights reserved.

 

OpenSpan data classification label