Change Sender in custom form (OL2000)

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
 
A

Amit Basu

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top