Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


VB Script on Outlook Form

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,35295
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> VB Script on Outlook Form
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 VB Script on Outlook Form - 6/9/2006 1:38:26 AM   
  BELCORE

 

Posts: 3
Score: 0
Joined: 6/2/2006
Status: offline

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...

Thanks for your help !

Victor Belcore
Senior System Analyst
212-460-4386
 
 
Post #: 1
 
 RE: VB Script on Outlook Form - 6/12/2006 12:19:24 AM   
  ebgreen


Posts: 4970
Score: 31
Joined: 7/12/2005
Status: offline
I would consider putting the code in the OnChange or OnClick event for the list/combo box.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to BELCORE)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> VB Script on Outlook Form Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts