Change Sender in custom form (OL2000)

  • Thread starter Thread starter Stefan
  • Start date Start date
S

Stefan

Hello,

I have the following problem:
A custom Outlook form is sent to userB by userA to get an inquiry
approved. UserB should either approve (the form will then be sent to
userC) or reject (form will be sent back to userA) the inquiry.
Unfortunately, the sender in the form is always userA. Therefor it is
not possible for userB to send the form.

How can I change the sender using VBScript? It should be allways the
current user since users A, B and C can be many different users.

thanks
Stefan
 
I have done something similar recently. Add a couple of buttons on the
Read Page of the form, one to Accept another to Reject. So when UserB
receives the form he will click either of the two buttons.
You'll code two Click event handlers for these two buttons and there
you'd put any values in the addressees (To, CC etc.) fields using VB
Script.

Here's a sample code:

Sub AckButton_Click()
Set myNameSpace = Application.GetNameSpace("MAPI")
Set replyItem = Application.CreateItem(olMailItem)

replyItem.To = Item.Sendername
replyItem.Subject = "ACCEPTED - " + myNameSpace.CurrentUser + " - " +
Item.Subject

If Err.Number = 0 Then
SaveInFolder(replyItem)
End If

If Err.Number = 0 Then
replyItem.Send
End If
End Sub

Hope this helps.
 
Back
Top