/ Forums / Advansys Formativ / Creating Solutions with Formativ / How can I move an attachment into a GW folder? / Reply To: How can I move an attachment into a GW folder?

#7842
Support 3
Participant

This is one of the limitation to the GroupWise API to not allow to move attached message. Not sure about whether there is any method exists in SOAP API.

Just to see whether any changes in GW 7.0.2, I have tried the following sample code to move the attached message (I have a plain text message with an embedded message) but it failed with error message “An invalid argument was passed in the function call.”. I have comment-out the code to move the root message which works.

  
  dim oMsg
  dim oSourceFolder
  dim oDestinationFolder

  ' Destination folder
  set oDestinationFolder = groupwise.account.allfolders.itembyname("Notes")

  ' selected message which contains the attach message.
  set oMsg = client.clientstate.commandmessage

  ' Access message source folder
  set oSourceFolder = oMsg.EnclosingFolders.item(1)
  msgbox "Source Folder: " & oSourceFolder.name

  ' Access the attach message
  set oAttachment = oMsg.attachments(1)
  msgbox "Attachment: " & oAttachment.displayname

  ' Move the attach message to a destination folder (DOES NOT WORK)
  if (oAttachment.ObjType = 2) then
    msgbox oAttachment.message.messageid
    call oSourceFolder.messages.move(oAttachment.message.messageid, oDestinationFolder.messages)
  end if

  ' Works: Move root message to destination folder
  'call oSourceFolder.messages.move(oMsg.messageid, oDestinationFolder.messages)

  set oDestinationFolder = nothing
  set oSourceFolder = nothing
  set oAttachment = nothing
  set oMsg = nothing

As this type of enquiry is related to the groupWise API, you may consider to post a message to the Novell Developer Support forum (http://forums.novell.com/category/developer.tpt).

Regards,
Advansys Support