/ Forums / Advansys Formativ / Creating Solutions with Formativ / Code for dragging an email into a folder

  • Creator
    Topic
  • #4360
    rizwan1212
    Participant

    I am new to Formativ Studio. I am trying to create an applet that would move an incoming email from the mailbox into a folder. Here’s the code that was generated when I recorded the applet by dragging an email from the mailbox into a folder titled, “My folder”:

    Sub Main(Client, GWEvent)
    Call GroupWise.FolderSelect(“John SmithCabinetMy folder”)
    End Sub

    It seems like it didn’t capture the call for moving an email into the selected folder. It only captured the call for selecting the folder. When I run this applet it simply opens the folder but does not move an email into it.

    How can I write a call for moving any incoming email into a designated folder. Thank you.

  • Author
    Replies
  • #7931
    Support 3
    Participant

    GroupWise does not expose all methods on moving messages. See the Object API (http://developer.novell.com/documentation/gwobjapi/index.html?gwobjenu/data/h7ikbsqg.html) for the methods to move messages. The code below should move the selected message to cabinet folder.

      
      dim oMsg
      dim oSourceFolder
    
      set oMsg = client.clientstate.commandmessage
    
      ' Get the source folder
      set oSourceFolder = oMsg.EnclosingFolders.item(1)
    
      ' Move the message
      call oSourceFolder.messages.move(oMsg, groupwise.account.cabinet.messages)
    
      set oSourceFolder = nothing
      set oMsg = nothing
    

    On a separate note, we have recently release Filing Assistant (http://advansyscorp.com/formativ_sol_filing_assistant.htm) solution to quickly locate folder and move selected messages.

    Hope this helps.

    Regards,
    Advansys Support

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