/ Forums / Advansys Formativ / Creating Solutions with Formativ / Syntax for Accessing Forwarded Messages

  • Creator
    Topic
  • #3865
    ToddM
    Participant

      I am trying to write an archiving script, and I am having trouble with the syntax for forwarded messages.

      Here is the code I am trying to run that is having a problem.

      FordwardMsg = objMsg.Attachments(y).Message

      where
      objMsg is a Groupwise message
      ForwardMsg is a new variable
      Attachments(y) is a object type of egwMessage(2)

      I keep getting the following error at this line in the code: “Object doesn’t support this property or method.”

      Does anyone have an idea of what I am doing wrong?

      Thanks in advance,

      Todd

    • Author
      Replies
    • #6440
      Support 2
      Moderator

        Hi,

        One of our engineers has written the following sample code which we hope will assist. Please let us know if you have any further questions.

        '-------------------------------------------------------------------------------
        ' This sample code will display a selected message's subject. If the selected message
        ' contains any message type attachments (ObjType = fgwMessage),
        ' the code below will display the attachment's subject and the body text.
        '-------------------------------------------------------------------------------

        Sub Main(Client, GWEvent)

        HRT = Chr(13) & Chr(10)

        on error resume next
        Set objMsg = Client.ClientState.CommandMessage

        if isobject(objMsg) then

        msgbox "Selected message's subject: " & objMsg.Subject & HRT &_
        "Total attachments: " & objMsg.Attachments.count

        if objMsg.Attachments.count > 0 then
        for y = 1 to objMsg.Attachments.count
        set FordwardMsg = objMsg.Attachments(y)

        ' If the attachment is a message type then proceed
        if FordwardMsg.ObjType = fgwMessage then
        msgbox "Attachment's subject: " & FordwardMsg.Message.Subject & HRT &_
        "Message: " & FordwardMsg.Message.BodyText
        end if

        set FordwardMsg = nothing
        next
        end if
        else
        msgbox "Select a message to continue."
        end if

        set objMsg = nothing

        End Sub

        Regards,

        Advansys Support

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