/ Forums / Advansys Formativ / Creating Solutions with Formativ / How to link an item to a folder?

  • Creator
    Topic
  • #4441
    dgerisch
    Participant

      Hello,

      I have a “move to folder” applet that works fine. Is it possible to do the same thing with a “link to folder” operation?

      Here is what I am doing:

      set oDestinationFolder = GroupWise.Account.Cabinet.AllFolders.ItemByName(“Archive”)

      iCount = Client.ClientState.SelectedMessages.Count

      If iCount > 0 Then

      For x = 1 To iCount

      ‘ Get the currently selected message
      Set oMsg = Client.ClientState.SelectedMessages.Item(x)

      ‘ Access message source folder
      set oSourceFolder = oMsg.EnclosingFolders.item(1)

      ‘ Move the message
      call oSourceFolder.messages.move(oMsg, oDestinationFolder.Messages)

      set oSourceFolder = nothing
      set oMsg = nothing

      Next

      Else

      Set oMsg = Client.ClientState.CommandMessage
      set oSourceFolder = oMsg.EnclosingFolders.item(1)
      call oSourceFolder.messages.move(oMsg, oDestinationFolder.Messages)

      End If

      I would like to change out “call oSourceFolder.messages.move(oMsg, oDestinationFolder.Messages)” with an equivalent ‘link’ operation instead, but I cannot find what the correct code would be.

      Thanks!

    • Author
      Replies
    • #8183
      Support 3
      Participant

        You will need to add the message to destination folder messages collection, see the Object API Messages object for more information.

        Code below link the selected message to “Archive” folder.

          
          dim oMsg
          dim oDestinationFolder
        
          set oDestinationFolder = GroupWise.Account.Cabinet.AllFolders.ItemByName("Archive")
        
          Set oMsg = Client.ClientState.CommandMessage
        
          oDestinationFolder.messages.add(oMsg)
        
          set oDestinationFolder = nothing
          set oMsg = nothing
        

        Hope this helps.

        Regards,
        Advansys Support

        #8185
        dgerisch
        Participant

          Thank you very much.

          #8184
          Support 3
          Participant

            No problem, glad it was of assistance.

            Regards,
            Advansys Support

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