I've been going crazy for weeks trying to do this...
In an Outlook Form (ver 2003) I created VB script that will populate To, Subject and Text Box (that's good)
I can connect this to a Button that will call the Sub I want based on Text in a Text box...
Sub BUTTON01_click if Item.GetInspector.ModifiedFormPages("Message").Controls ("dept").text = "Customer Accounting" then Call PREPsend01 if Item.GetInspector.ModifiedFormPages("Message").Controls ("dept").text = "Credit and Collections" then Call PREPsend02 if Item.GetInspector.ModifiedFormPages("Message").Controls ("dept").text = "Meter Action Group" then Call PREPsend03 if Item.GetInspector.ModifiedFormPages("Message").Controls ("dept").text = "Meter Operations – cycle FPET" then Call PREPsend04 if Item.GetInspector.ModifiedFormPages("Message").Controls ("dept").text = "Meter Operations – non-routine FPET" then Call PREPsend05 if Item.GetInspector.ModifiedFormPages("Message").Controls ("dept").text = "Rate Engineering" then Call PREPsend06 if Item.GetInspector.ModifiedFormPages("Message").Controls ("dept").text = "Auditing" then Call PREPsend07 if Item.GetInspector.ModifiedFormPages("Message").Controls ("dept").text = "Corporate Accounting" then Call PREPsend08 if Item.GetInspector.ModifiedFormPages("Message").Controls ("dept").text = "Treasury" then Call PREPsend09 if Item.GetInspector.ModifiedFormPages("Message").Controls ("dept").text = "IVR Requests" then Call PREPsend10 if Item.GetInspector.ModifiedFormPages("Message").Controls ("dept").text = "Internal OAS" then Call PREPsend11 END SUB
Sub PREPsend01 Set MyNameSpace = Application.GetNameSpace("MAPI") Set MyPage = Item.GetInspector.ModifiedFormPages("Message") Set MyControls = Mypage.Controls Item.To = "BELCORE,VICTOR" Item.CC = "BARBATO,KRISTEN" Item.Subject = "USER REQUEST - Customer Accounting (Pre-Approval)" Item.GetInspector.ModifiedFormPages("Message").Controls ("Choice1").Text = "Customer Accounting" Item.GetInspector.ModifiedFormPages("Message").Controls ("Choice2").Text = "Customer Accounting" End Sub
(This Works)
What I want to do is trigger the script with a List or Combo Box... (instead of a button)
When I give the Click Sub with the Name of the List or Combo Box... it won't trigger the script I'm sure this can be done, but cannot find the syntax...