Ok, see code below,
Option Explicit
Dim m_blnIsNew
Dim m_ExcluYesCB
Dim m_ExcluAppCB
Dim m_ExcluntegCB
Dim m_OERNone
Dim m_OERRefData
Dim m_OERDealE
Dim m_OEReDown
Dim m_OERSNAP
Dim m_OERMDS
Dim m_OEREDI
Dim m_OEREDW
Dim m_OERUSEx
Dim m_OERALPS
Dim m_OERTAS
Dim m_OERPR4
Dim m_OERXI
Dim m_OERManu
Dim m_OERVitria
Dim m_OEROlym
Dim m_OERKinder
Dim m_TestIntegration
Dim m_TestString
Dim m_TestUAT
Dim m_TestTraining
Dim m_TestSoak
Dim m_TestStress
Dim m_TestOther
Dim m_TestText
Dim m_AppCodeRem
Dim m_ILCodeRem
Dim m_IMOSDatabase
Dim m_ODMDatabase
Dim m_ORMDatabase
Dim m_UEHDatabase
Dim m_SEQDatabase
Dim m_AuditDatabase
Function Item_Open()
Call InitForm
End Function
Function Item_Reply(ByVal Response)
Call InitForm
End Function
Function Item_ReplyAll(ByVal Response)
Call InitForm
End Function
Function Item_Forward(ByVal ForwardItem)
Call InitForm
End Function
Sub InitForm()
If Item.Size = 0 Then
m_blnIsNew = True
Else
m_blnIsNew = False
End If
Set m_ExcluYesCB =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox42")
Set m_ExcluAppCB =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox4")
Set m_ExcluntegCB =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox5")
Set m_OERNone =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox13")
Set m_OERRefData =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox14")
Set m_OERDealE =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox15")
Set m_OEReDown =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox21")
Set m_OERSNAP =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox22")
Set m_OERMDS =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox16")
Set m_OEREDI =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox17")
Set m_OEREDW =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox20")
Set m_OERUSEx =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox23")
Set m_OERALPS =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox24")
Set m_OERTAS =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox26")
Set m_OERPR4 =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox28")
Set m_OERXI =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox29")
Set m_OERManu =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox25")
Set m_OERVitria =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox27")
Set m_OEROlym =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox18")
Set m_OERKinder =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox19")
Set m_TestIntegration =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox6")
Set m_TestString =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox7")
Set m_TestUAT =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox8")
Set m_TestTraining =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox9")
Set m_TestSoak =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox10")
Set m_TestStress =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox11")
Set m_TestOther =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox12")
Set m_TestText =
Item.GetInspector.ModifiedFormPages("Message").Controls("TextBox4")
Set m_AppCodeRem =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox40")
Set m_ILCodeRem =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox41")
Set m_IMOSDatabase =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox30")
Set m_ODMDatabase =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox31")
Set m_ORMDatabase =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox32")
Set m_UEHDatabase =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox34")
Set m_SEQDatabase =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox33")
Set m_AuditDatabase =
Item.GetInspector.ModifiedFormPages("Message").Controls("CheckBox35")
If m_blnIsNew And Item.UserProperties.Find("Request Number").Value = ""
Then
Item.UserProperties.Find("Request Number").Value = Chr(64 +
Month(Now)) & _
AddLeadingZeroUnderTen(Day(Now)) & _
Chr(64 +
right(Year(Now), 2)) & _
"-" & Chr(65 +
Hour(Now)) & _
AddLeadingZeroUnderTen(Minute(Now)) & _
AddLeadingZeroUnderTen(Second(Now))
Else
Call SetExclusivity
Call SetEnvironmentsRequested
Call SetDatabaseSetup
Call SetEnvironmentListRequestType
End If
End Sub
Sub Item_CustomPropertyChange(ByVal Name)
Select Case Name
Case "Exclusivity Yes"
Call SetExclusivity
Case "Exclusivity No"
Call SetExclusivity
Case "Environments Requested None"
Call SetEnvironmentsRequested
Case "Database Setup None"
Call SetDatabaseSetup
Case "Environment List"
Call SetEnvironmentListRequestType
Case "Request Type"
Call SetEnvironmentListRequestType
End Select
End Sub
Function SetExclusivity()
If Item.UserProperties.Find("Exclusivity No").Value = "True" Then
Item.UserProperties.Find("Exclusivity Yes").Value = "False"
m_ExcluYesCB.Enabled = 0
m_ExcluAppCB.Enabled = 0
m_ExcluntegCB.Enabled = 0
Item.UserProperties.Find("Exclusivity Application").Value = "False"
Item.UserProperties.Find("Exclusivity Integration Layer").Value =
"False"
Else
Item.UserProperties.Find("Exclusivity Yes").Value = "True"
m_ExcluYesCB.Enabled = 1
m_ExcluAppCB.Enabled = 1
m_ExcluntegCB.Enabled = 1
End If
End Function
Function SetEnvironmentsRequested()
If Item.UserProperties.Find("Environments Requested None").Value =
"False" Then
m_OERRefData.Enabled = 1
m_OERDealE.Enabled = 1
m_OEReDown.Enabled = 1
m_OERSNAP.Enabled = 1
m_OERMDS.Enabled = 1
m_OEREDI.Enabled = 1
m_OEREDW.Enabled = 1
m_OERUSEx.Enabled = 1
m_OERALPS.Enabled = 1
m_OERTAS.Enabled = 1
m_OERPR4.Enabled = 1
m_OERXI.Enabled = 1
m_OERManu.Enabled = 1
m_OERVitria.Enabled = 1
m_OEROlym.Enabled = 1
m_OERKinder.Enabled = 1
Else
m_OERRefData.Enabled = 0
m_OERDealE.Enabled = 0
m_OEReDown.Enabled = 0
m_OERSNAP.Enabled = 0
m_OERMDS.Enabled = 0
m_OEREDI.Enabled = 0
m_OEREDW.Enabled = 0
m_OERUSEx.Enabled = 0
m_OERALPS.Enabled = 0
m_OERTAS.Enabled = 0
m_OERPR4.Enabled = 0
m_OERXI.Enabled = 0
m_OERManu.Enabled = 0
m_OERVitria.Enabled = 0
m_OEROlym.Enabled = 0
m_OERKinder.Enabled = 0
Item.UserProperties.Find("Environments Requested RefData").Value =
"False"
Item.UserProperties.Find("Environments Requested Deal Entr").Value =
"False"
Item.UserProperties.Find("Environments Requested eDown").Value =
"False"
Item.UserProperties.Find("Environments Requested SNAP").Value =
"False"
Item.UserProperties.Find("Environments Requested MDS").Value =
"False"
Item.UserProperties.Find("Environments Requested EDI").Value =
"False"
Item.UserProperties.Find("Environments Requested EDW").Value =
"False"
Item.UserProperties.Find("Environments Requested US Expo").Value =
"False"
Item.UserProperties.Find("Environments Requested ALPS").Value =
"False"
Item.UserProperties.Find("Environments Requested TAS").Value =
"False"
Item.UserProperties.Find("Environments Requested SAP PR4").Value =
"False"
Item.UserProperties.Find("Environments Requested SAP XI").Value =
"False"
Item.UserProperties.Find("Environments Requested Manugist").Value =
"False"
Item.UserProperties.Find("Environments Requested Vitria").Value =
"False"
Item.UserProperties.Find("Environments Requested Olympic").Value =
"False"
Item.UserProperties.Find("Environments Requested Kinder").Value =
"False"
End If
End Function
Function SetDatabaseSetup()
If Item.UserProperties.Find("Database Setup None").Value = "False" Then
m_IMOSDatabase.Enabled = 1
m_ODMDatabase.Enabled = 1
m_ORMDatabase.Enabled = 1
m_UEHDatabase.Enabled = 1
m_SEQDatabase.Enabled = 1
m_AuditDatabase.Enabled = 1
Else
m_IMOSDatabase.Enabled = 0
m_ODMDatabase.Enabled = 0
m_ORMDatabase.Enabled = 0
m_UEHDatabase.Enabled = 0
m_SEQDatabase.Enabled = 0
m_AuditDatabase.Enabled = 0
Item.UserProperties.Find("Database Setup IMOS").Value = "False"
Item.UserProperties.Find("Database Setup ODM").Value = "False"
Item.UserProperties.Find("Database Setup ORM").Value = "False"
Item.UserProperties.Find("Database Setup UEH").Value = "False"
Item.UserProperties.Find("Database Setup SEQ").Value = "False"
Item.UserProperties.Find("Database Setup Audit").Value = "False"
End If
End Function
Function SetEnvironmentListRequestType()
If Item.UserProperties.Find("Request Type").Value = "Testing Request" Then
m_TestOther.Enabled = 1
m_TestText.Enabled = 1
m_TestText.BackColor = &h80000005
If Item.UserProperties.Find("Environment List").Value = "Development" Then
m_TestIntegration.Enabled = 0
m_TestString.Enabled = 0
m_TestUAT.Enabled = 0
m_TestTraining.Enabled = 0
m_TestSoak.Enabled = 0
m_TestStress.Enabled = 0
Item.UserProperties.Find("Testing Integration").Value = "False"
Item.UserProperties.Find("Testing String").Value = "False"
Item.UserProperties.Find("Testing UAT").Value = "False"
Item.UserProperties.Find("Testing Training").Value = "False"
Item.UserProperties.Find("Testing Soak").Value = "False"
Item.UserProperties.Find("Testing Stress").Value = "False"
End If
If Item.UserProperties.Find("Environment List").Value = "Integration /
Migration" Then
m_TestString.Enabled = 1
m_TestIntegration.Enabled = 1
m_TestUAT.Enabled = 0
m_TestTraining.Enabled = 0
m_TestSoak.Enabled = 0
m_TestStress.Enabled = 0
Item.UserProperties.Find("Testing UAT").Value = "False"
Item.UserProperties.Find("Testing Training").Value = "False"
Item.UserProperties.Find("Testing Soak").Value = "False"
Item.UserProperties.Find("Testing Stress").Value = "False"
End If
If Item.UserProperties.Find("Environment List").Value = "UAT / Training" Then
m_TestUAT.Enabled = 1
m_TestTraining.Enabled = 1
m_TestIntegration.Enabled = 0
m_TestString.Enabled = 0
m_TestSoak.Enabled = 0
m_TestStress.Enabled = 0
Item.UserProperties.Find("Testing Integration").Value = "False"
Item.UserProperties.Find("Testing String").Value = "False"
Item.UserProperties.Find("Testing Soak").Value = "False"
Item.UserProperties.Find("Testing Stress").Value = "False"
End If
If Item.UserProperties.Find("Environment List").Value = "Technical
Testing" Then
m_TestSoak.Enabled = 1
m_TestStress.Enabled = 1
m_TestIntegration.Enabled = 0
m_TestString.Enabled = 0
m_TestUAT.Enabled = 0
m_TestTraining.Enabled = 0
Item.UserProperties.Find("Testing Integration").Value = "False"
Item.UserProperties.Find("Testing String").Value = "False"
Item.UserProperties.Find("Testing UAT").Value = "False"
Item.UserProperties.Find("Testing Training").Value = "False"
End If
Else
m_TestIntegration.Enabled = 0
m_TestString.Enabled = 0
m_TestUAT.Enabled = 0
m_TestTraining.Enabled = 0
m_TestSoak.Enabled = 0
m_TestStress.Enabled = 0
m_TestOther.Enabled = 0
m_TestText.Enabled = 0
m_TestText.BackColor = &h80000016
Item.UserProperties.Find("Testing Integration").Value = "False"
Item.UserProperties.Find("Testing String").Value = "False"
Item.UserProperties.Find("Testing UAT").Value = "False"
Item.UserProperties.Find("Testing Training").Value = "False"
Item.UserProperties.Find("Testing Soak").Value = "False"
Item.UserProperties.Find("Testing Stress").Value = "False"
Item.UserProperties.Find("Testing Text").Value = ""
End If
End Function
Function Item_Send()
Dim blnOKToSend
Dim recip
Dim oRecip
blnOKToSend = False
For Each recip in Item.Recipients
If recip.Address = "/o=BP/ou=USAHOU/cn=Users/cn=rilej3" Then
blnOKToSend = True
Exit For
End If
Next
If blnOKToSend = False Then
Set oRecip = Item.Recipients.Add("
[email protected]")
oRecip.Resolve
blnOKToSend = True
Set oRecip = Nothing
End If
Item_Send = blnOKToSend
Set blnOKToSend = Nothing
Set recip = Nothing
Call SetNothing
End Function
Function Item_Close()
Call SetNothing
End Function
Function AddLeadingZeroUnderTen(strNum)
If CInt(strNum) < 10 Then
strNum = "0" & strNum
End If
AddLeadingZeroUnderTen = strNum
End Function
Function SetNothing()
Set m_blnIsNew = Nothing
Set m_ExcluYesCB = Nothing
Set m_ExcluAppCB = Nothing
Set m_ExcluntegCB = Nothing
Set m_OERNone = Nothing
Set m_OERRefData = Nothing
Set m_OERDealE = Nothing
Set m_OEReDown = Nothing
Set m_OERSNAP = Nothing
Set m_OERMDS = Nothing
Set m_OEREDI = Nothing
Set m_OEREDW = Nothing
Set m_OERUSEx = Nothing
Set m_OERALPS = Nothing
Set m_OERTAS = Nothing
Set m_OERPR4 = Nothing
Set m_OERXI = Nothing
Set m_OERManu = Nothing
Set m_OERVitria = Nothing
Set m_OEROlym = Nothing
Set m_OERKinder = Nothing
Set m_TestIntegration = Nothing
Set m_TestString = Nothing
Set m_TestUAT = Nothing
Set m_TestTraining = Nothing
Set m_TestSoak = Nothing
Set m_TestStress = Nothing
Set m_TestOther = Nothing
Set m_TestText = Nothing
Set m_AppCodeRem = Nothing
Set m_ILCodeRem = Nothing
Set m_IMOSDatabase = Nothing
Set m_ODMDatabase = Nothing
Set m_ORMDatabase = Nothing
Set m_UEHDatabase = Nothing
Set m_SEQDatabase = Nothing
Set m_AuditDatabase = Nothing
End Function