/ Forums / Advansys Formativ / Creating Solutions with Formativ / use of “FolderMoveTo” / Reply To: use of “FolderMoveTo”
October 15, 2003 at 6:26 pm
#6728
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