Shellgrip
10-11-2005, 04:04 AM
Hi, I'm sure this is dead simple but I'm completely confused by Outlook and am struggling to work out what is called what and... well, I need help.
I have a custom IPM.Post form and on it are three check boxes. All I want is for a mail to be sent when these check boxes change their value. To simplify installation I need the code to be embedded with the form as a script, not an Outlook VBA routine.
So far I have this:
Sub Item_CustomPropertyChange(ByVal Name)
Set olApp = CreateObject("Outlook.Application")
Set olNameSpace = OlApp.GetNameSpace("MAPI")
Select Case Name
Case "Collection booked"
Set MailNoti = OlApp.CreateItem(0)
MailNoti.To = "jon@mycompany.com"
MailNoti.Subject = "Collection Booked"
Message = "Your Shipping Request to has been booked!"
MailNoti.Body = Message
MailNoti.Send
End Select
End Sub
Which works (I'll add more Case statements once I've got one working!), but what I really need is a) for the email address to be the original poster of the form, b) for the Message body to include the Subject field on that form (as part of a sentence).
I know I need to reference the form in some way to find the 'sender' and the subject but I'm lost as to how. Can anyone help?
FYI the form is called IPM.Post.ShipReq
Jon
I have a custom IPM.Post form and on it are three check boxes. All I want is for a mail to be sent when these check boxes change their value. To simplify installation I need the code to be embedded with the form as a script, not an Outlook VBA routine.
So far I have this:
Sub Item_CustomPropertyChange(ByVal Name)
Set olApp = CreateObject("Outlook.Application")
Set olNameSpace = OlApp.GetNameSpace("MAPI")
Select Case Name
Case "Collection booked"
Set MailNoti = OlApp.CreateItem(0)
MailNoti.To = "jon@mycompany.com"
MailNoti.Subject = "Collection Booked"
Message = "Your Shipping Request to has been booked!"
MailNoti.Body = Message
MailNoti.Send
End Select
End Sub
Which works (I'll add more Case statements once I've got one working!), but what I really need is a) for the email address to be the original poster of the form, b) for the Message body to include the Subject field on that form (as part of a sentence).
I know I need to reference the form in some way to find the 'sender' and the subject but I'm lost as to how. Can anyone help?
FYI the form is called IPM.Post.ShipReq
Jon