/ Forums / Advansys Formativ / Creating Solutions with Formativ / If-then-else statement , if mail is send local / Reply To: If-then-else statement , if mail is send local

Support 1

You can do this in several ways; using a script variable to store the message body is one reasonable option.

Here is another way. Find in the Token API looks for text in the message body. If successful, Find also selects the text. Unfortunately Find does not return True/False. But as the following code shows, we can copy the selected text to the clipboard and do a string comparison.

  dim iText

  ' Set up the search text
  iText = "disclaimer/confidentiality"

  ' Clear the clipboard
  ' Set the focus to message body and point to the beginning of the first line.
  call GroupWise.FocusSet(fcsMessage, "")
  call GroupWise.PosTextTop
  ' Find the text
  call GroupWise.Find("", "", iText, _
    fsdForward, matSubText, matSubText, matSubText)
  ' Copy to clipboard
  call GroupWise.EditCopy
  If (InStr(1, Utilities.FromClipBoard(), iText, vbTextCompare) > 0) then
    call MsgBox("Found the disclaimer language.")
    call MsgBox("Did not find disclaimer language.")
  end if

I hope this helps.

Advansys Support