/ Forums / Advansys Formativ / Creating Solutions with Formativ / use of “FolderMoveTo”

  • Creator
    Topic
  • #3967
    Anonymous

    Hi,

    I’m trying to use the “FolderMoveTo”, but the syntax as in the helpd doesn’t seem to work. messages are removed from the originating folder, but don’t appear in the designated folder. Could anybody provide a small sample?

  • Author
    Replies
  • #6728
    Support 1
    Participant

    The GroupWise token

    FolderMoveTo(Source, Target)

    does not move messages from one folder to another. Rather, it moves the folder; in other words, it makes Source a sub-folder of Target.

    I think the sample code below does what you are want. It uses Object API to move messages from one folder to another folder.

    '-------------------------------------------------------------------------------
    ' Move all messages from the 'Work In Progress' folder into 'Cabinet'.
    '-------------------------------------------------------------------------------
    Sub Main(Client, GWEvent)
     
     dim x
     dim iCounter
     dim oWIPMessages
     dim oCabinetMessages
     
     set oWIPMessages = GroupWise.account.WorkFolder.Messages
     iCounter = oWIPMessages.count
     
     if (iCounter = 0) then
       msgbox "No messages to move from the Work In Progress folder."
       exit sub
     end if
     
     set oCabinetMessages = GroupWise.account.Cabinet.Messages
     
    
     for x = iCounter to 1 step -1
       msgbox x
       call oWIPMessages.Move(x, oCabinetMessages)
     next
     
     msgbox(iCounter & " messages moved from WIP to Cabinet.")
     
     set oWIPMessages = nothing
     set oCabinetMessages = nothing
     
    End Sub
    

    I hope this example is helpful to you.

    Advansys Support

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