• Creator
    Topic
  • #4218
    brian@hwnn.com
    Participant

      I am following along with some code from the help files to make a ‘print item list’ applet. Using the example code I can get the selectedmessages and access properties of each. The problem comes when I try to access a property that isn’t available for that message type (like ‘Place’ in an email message). Here is the code from the help text:

      Dim objMsg
      ‘ 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 message
      Set objMsg = Client.ClientState.SelectedMessages.Item(x)

      — end snip

      How do I test the objMsg to determine if it is an appointment, task, note, email, etc.?

      Thanks,
      Brian

    • Author
      Replies
    • #7515
      Support 1
      Participant

        Thank you for your enquiry.

        You will need to test the ClassName property of the Message object. This web reference is documented in the Introduction to the Formativ Developers Guide.

        Here is some sample code to get you started:

          iClassName = oMessage.ClassName
          If InStr(1, iClassName, "GW.MESSAGE.MAIL", vbTextCompare) = 1 Then
            ' Process Mail message...
          Elseif InStr(1, iClassName, "GW.MESSAGE.APPOINTMENT", vbTextCompare) = 1 Then
            ' Process Appointment message...
          Elseif InStr(1, iClassName, "GW.MESSAGE.TASK", vbTextCompare) = 1 Then
            ' Process Task message...
          Elseif InStr(1, iClassName, "GW.MESSAGE.NOTE", vbTextCompare) = 1 Then
            ' Process Note message...
          Elseif InStr(1, iClassName, "GW.MESSAGE.PHONE", vbTextCompare) = 1 Then
            ' Process Phone message...
          Elseif InStr(1, iClassName, "GW.MESSAGE.DOCUMENTREFERENCE", vbTextCompare) = 1 Then
            ' Process DocRef message...
          End If
        

        I hope this helps.

        Regards,
        Advansys Support

        #7514
        brian@hwnn.com
        Participant

          That works perfectly! Thanks for the code and the link.

          Brian

          #7513
          Support 1
          Participant

            No problem.

            Note: The sample code acknowledges the possibility that an existing message class can be subclassed. The test against class name looks for a substring, not an exact match. For more details on subclassing messages, see the Novell Web reference cited above.

            Regards,
            Advansys Support

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