/ Forums / Advansys Formativ / Creating Solutions with Formativ / Message view – how can I tell?

  • Creator
    Topic
  • #4331
    dgerisch
    Participant

      I have an applet I have distributed to all my users that lets them forward selected messages. I realize now that I should discriminate between email that came off the internet, and email that came from internal users. Within GroupWise, there is the View Name = Internet attribute (or some other view name if it did not come from the GWIA). Would someone please tell me how to test for the current messages’ view name within Formativ? I looked through a number of sample applications but did not find it – perhaps I just did not look in the right application.

      Thanks!

    • Author
      Replies
    • #7844
      Support 3
      Participant

        I am not sure about indentify the internal or external message based on view name. You can use the the following token to return the name of the active view:
        Groupwise.EnvCurrentViewName

        Alternatively, please view the following thread which has some sample code to check the external message:
        http://www.advansyscorp.com/forums/topic/5314075312/

        Hope this helps.

        Regards,
        Advansys Support

        #7845
        dgerisch
        Participant

          I eventually solved this using a search on the address book. Maybe not as nice as GroupWise.AddressBookResolveFullName(), but it’s an alternative.

          Set oAddressBook = GroupWise.Account.AddressBooks.Item("Novell GroupWise Address Book")
          
          ' Find out how many items are selected in GroupWise
          iCount = Client.ClientState.SelectedMessages.Count
          
          ' If any are selected, access each one
          If iCount > 0 Then
          
              For x = 1 To iCount
          
                  ' Get the currently selected message
                  Set iMsg = Client.ClientState.SelectedMessages.Item(x)
          
                  strEmailAddress = iMsg.Sender.EmailAddress
                  
                  Set oEntries = nothing
          
                  Set oEntries = oAddressBook.AddressBookEntries.Find("(<E-Mail Address> CONTAINS """ & strEmailAddress & """)")
          
                  iText = ""
          
                  For each oEntry in oEntries
          
                      Set oFields = oEntry.Fields
          
                      For each oField in oFields
                          iText = iText & "Name: " & oField.Name & ", Value: " & oField.Value & CRLF
                          If oField.Name = "Name" Then
                              strDisplayName = oField.Value
                          End If
                      Next
          
                  Next
          
                  If iText = "" then
          
                      ' Send the email by calling the send method
                      ' (more code goes here)
          
                  Else
          
                      call MsgBox( strDisplayName & " is in GroupWise - you can't tag internal user mail as spam.", 64, CAPTION )
          
                  End If
          
                  set iMsg = nothing
          
              Next
          
          End If
          
          #7843
          Support 3
          Participant

            Thanks for sharing the sample code.

            Regards,
            Advansys support

          Viewing 3 replies - 1 through 3 (of 3 total)
          • You must be logged in to reply to this topic.