Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outlook - sending a reply via VBScript

Status
Not open for further replies.

HaworthBantam

Programmer
Jan 31, 2002
132
0
0
GB
I've created an Outlook form where the Edit Compose Page and the Edit Read Page are identical, except for field names. The form also has a Page 2 that must be completed by the recipient and returned to sender (the "King" still is "The King"). I have a button on Page 2 that, when clicked, should return the original mail to the sender with Page 2 completed. Unfortunately when the recipient completes Page 2 and clicks the button to return the mail the following error message appears :

"You do not have the permission to send the message on behalf of the specified user"

The code behind the button is.....

Sub cmdReply_Click

Set MyItem=Item.GetInspector.CurrentItem
Set MyPage=Item.GetInspector.ModifiedFormPages("Page 2")

'Various Validation here of fields using MyPage etc.

MyItem.Send

End Sub

I've tried determining the original sender....

strSender = MyItem.SenderName

...and adding him/her to the recipients list before sending.....

MyItem.Recipients.Add(strSender)

....but still no luck.

Any help would be gratefully appreciated and I appologise in advance if I'm being a numpty - my knowledge of Oulook VB Script is very limited.
 
Instead of MyItem.Send have you tried MyItem.Reply?
 
HaworthBantam,

Your Outlook is associated with someone's mailbox and also has a password to get into that mailbox. Your web pages are also associated with an account "IUSR_?????" Does IUSR_???? hava access to that mailbox so it can send?


fengshui_1998
 
Tried MyItem.Reply but still received the error message.

Gone through a little more testing and found that the recipient is effectively resending the mail message on behalf of the original sender, hence the original message of "You do not have the permission to send the message on behalf of the specified user".

I've decided to have the mail create a new mail message based on info entered by the recipient and send that rather than send the original mail back to the original sender.

Maybe I'll stick to VB6 in future, and well away from Outlook !

Thanks for your help anyway mcm103 and FengShui1998.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top