/ Forums / Advansys Formativ / Creating Solutions with Formativ / ItemSaveMessageDraft / Reply To: ItemSaveMessageDraft
One of our engineers has supplied the following code to save an item to the Work In Progress folder. Once saved, you could add a custom field using the Object API:
dim oMsg
dim iMsgID
dim iFolderPath
dim iCounter
' Save the composing message to WIP folder
iFolderPath = groupwise.account.owner.displayname & "" &_
groupwise.account.workfolder.name
Groupwise.ItemSaveMessageDraft(iFolderPath)
' Get the message ID from view
iMsgID = groupwise.ItemMessageIDFromView()
' Some message with large attachments can take some time to save.
iCounter = 0
do while iMsgID = "X00"
utilities.Timer(1)
utilities.DoEvents()
iMsgID = groupwise.ItemMessageIDFromView()
iCounter = iCounter + 1
' Exit, if we do not get the proper message id
if (iCounter >= 10) then
exit do
end if
loop
if iMsgID = "X00" then
msgbox "Message ID not valid."
exit sub
end if
' Get the saved message
set oMsg = nothing
set oMsg = groupwise.account.getmessage(iMsgID)
if oMsg is nothing then
exit sub
end if
msgbox oMsg.subject
set oMsg = nothing
Another approach might be to attach a specially named and encoded file attachment to the draft message. The attachment would contain the ID information you need to associate with the message.
The term ‘current message’ means either the message being composed, or the currently selected message.
I am not aware of any fields you can access when working with a composing message that won’t be obtrusive to the user. In the past we have done similar things by adding encoding to the end of the body text of the composing message. I don’t know if this would be acceptable in your case.
I hope this helps.
Advansys Support
[This message was edited by Support 3 on July 07, 2005 at 05:05 PM.]