#7516
Support 3
Participant

Hi,

The Routing Mail message example does not support attachments. If you are updating the solution to support attachments then refer to the Object API documentation, specially the Message, Attachments and Attachment object. See below the sample code to add and view attachments.

Add a file type attachment…

Message.Attachments.Add(“c:temptest.txt”, egwFile, “”)

View available attachments…

for each attachment in oMsg.attachments
msgbox attachment.displayname
next

quote:


I have been attempting to add code to add a custom field to hold the attachment files but with little success. Any advice on this matter would be greatly appreciated.


I am not sure why you want to add the attachment files to custom field. I think you should use the Message.Attachments collection to manage the attachments. The sample code below add a custom field to a message.

———————–
on error resume next

‘ Get the selected message object.
set oMsg = nothing
set oMsg = Client.clientstate.commandmessage
if oMsg is nothing then
exit sub
end if

‘ Make sure the field definition exists in the account. Add the field definition if
‘ not exists. You may need to restart the GroupWise client to refresh the field definitions
‘ collection.
set oFieldDef = nothing
Set oFieldDef = GroupWise.Account.FieldDefinitions.Item(“Field Name”, fgwString)

if oFieldDef is nothing then
Set oFieldDef = GroupWise.Account.FieldDefinitions.Add(“Field Name”, fgwString)
end if

‘ Add the field into message fields collection
call oMsg.Fields.Add(“Field Name”, fgwString, “c:temptest.txt”)

set oMsg = nothing
set oFieldDef= nothing
———————–

Hope this helps.

Regards,
Advansys Support