Hey!
I created a custom form (IPM.Note) with three frames, text box and CommandButtons on page 2.
The first user (Address1) should complete the form and send by CommandbuttonA_click to the second user (address2). User2 should write in his TextBox Forward it (CommandbuttonB_click) to the third user (Address3).
The first sending works (Sub commandbuttonA_click), but there is an error after forward: In the Inbox of address2 the following error code appears: [578:0x000004DC:0x0000001D]
Code:
Sub CommandButtonA_click()
Dim adress1, adress2
Dim var_Inspector, var_Item
Dim page
Set var_Inspector = Application.ActiveInspector
Set var_Item = var_Inspector.CurrentItem
Set page = Item.GetInspector.ModifiedFormPages("P.2")
While var_Item.Recipients.Count > 0
var_Item.Recipients(1).Delete
Wend
adress1 = "test1@test.com"
adress2 = "test2@test.com"
var_Item.Subject = "Subject"
var_Item.Recipients.Add(adress2).Resolve
var_Item.Body = "command"
var_Item.Send
MsgBox "Send to: " & adress2
var_Inspector = Nothing
var_Item = Nothing
seite = Nothing
End Sub
Sub CommandButtonB_click()
Dim adress1, adress2, adress3
Dim var_Inspector, var_Item
Dim page
Set var_Inspector = Application.ActiveInspector
Set var_Item = var_Inspector.CurrentItem
Set page = Item.GetInspector.ModifiedFormPages("P.2")
adress3 = test3@test.com
'MsgBox "var_Item.Recipients(1): " & var_Item.Recipients(1)
While var_Item.Recipients.Count > 0
var_Item.Recipients(1).Delete
Wend
var_Item.Recipients.Add(adress3).Resolve
var_Item.To = adress3
var_Item.Forward
var_Item.Send
var_Inspector = Nothing
var_Item = Nothing
seite = Nothing
End Sub
On the web I found the error [578: 0x000004DC: 0x0000001D] only in conjunction with MS Exchange, which I do not know much about. The forward function of the form is necessary or the application, so that the form can be forwarded to a number of recipients.
Maybe it's the MailItem.SenderMailAdress, or other read-only properties?
Can anyone help?