W
winternan
Hi,
I have created an approval request form which can be sent to users for
approval or rejection. The recipient can then either 'approve' or 'reject'
by clicking on voting buttons from within the form. Either button click
triggers 'approve' or 'reject' forms (which are duplicates of the original
form) to be sent back to the user and copied to a public folder. The
'approve' or 'reject' forms retain text from the original request form in
every text box apart from the email message text box. Does anyone know why
this is?
I had the same problem with the 'approve' and 'reject' forms retaining
attachments and found the following vb code:
Function Item_CustomAction(ByVal Action, ByVal NewItem)
If Action.Name = "Activity Approved" Then
Call CopyAttachments(Item, NewItem)
Item.close(1)
Else
Item.save
Call CopyAttachments(Item, NewItem)
Item.Close(1)
End If
End Function
Sub CopyAttachments(objSourceItem, objTargetItem)
Set fso = CreateObject("Scripting.FileSystemObject")
Set fldTemp = fso.GetSpecialFolder(2) ' TemporaryFolder
strPath = fldTemp.Path & "\"
For Each objAtt In objSourceItem.Attachments
strFile = strPath & objAtt.FileName
objAtt.SaveAsFile strFile
objTargetItem.Attachments.Add strFile, , , objAtt.DisplayName
fso.DeleteFile strFile
Next
Set fldTemp = Nothing
Set fso = Nothing
End Sub
How do I modify this code to save the email message text as well? I'm not
really a programmer so any help would be MUCH appreciated.
Nancy.
I have created an approval request form which can be sent to users for
approval or rejection. The recipient can then either 'approve' or 'reject'
by clicking on voting buttons from within the form. Either button click
triggers 'approve' or 'reject' forms (which are duplicates of the original
form) to be sent back to the user and copied to a public folder. The
'approve' or 'reject' forms retain text from the original request form in
every text box apart from the email message text box. Does anyone know why
this is?
I had the same problem with the 'approve' and 'reject' forms retaining
attachments and found the following vb code:
Function Item_CustomAction(ByVal Action, ByVal NewItem)
If Action.Name = "Activity Approved" Then
Call CopyAttachments(Item, NewItem)
Item.close(1)
Else
Item.save
Call CopyAttachments(Item, NewItem)
Item.Close(1)
End If
End Function
Sub CopyAttachments(objSourceItem, objTargetItem)
Set fso = CreateObject("Scripting.FileSystemObject")
Set fldTemp = fso.GetSpecialFolder(2) ' TemporaryFolder
strPath = fldTemp.Path & "\"
For Each objAtt In objSourceItem.Attachments
strFile = strPath & objAtt.FileName
objAtt.SaveAsFile strFile
objTargetItem.Attachments.Add strFile, , , objAtt.DisplayName
fso.DeleteFile strFile
Next
Set fldTemp = Nothing
Set fso = Nothing
End Sub
How do I modify this code to save the email message text as well? I'm not
really a programmer so any help would be MUCH appreciated.
Nancy.