I'm trying to add project codes dropdown at custom form. Once user selected the project codes, it will display it at the end of the subject.
This is the code that I have right now. Everthing working fine untill when I received the sent email. The email wont automatically open like normal message, instead it will display it as attached file.
This is the custom form.
I'm trying to send the email.
received email will need to click it before can read it. I want to display it as normal message instead of attachement.
This is my current code :
Dim ComboBox1
Dim TextBox1
Dim Subject
Sub ComboBox1_Click()
ProjectCodes = ComboBox1.Text
Select Case ProjectCodes
Case "999999"
TextBox1.Text = "General"
Case "2017004"
TextBox1.Text = "IMW Waste based Biogas Power Plant at Sg Bakap, Penang"
Case "3116008"
TextBox1.Text = "OE Upgradation of Sirajganj Power Plant 3rd Unit Dual Fuel"
Case "1317023"
TextBox1.Text = "C&S Cadangan Pembangunan Springhill Clubhouse, Port Dickson"
Case "GDS0132"
TextBox1.Text = "Airborne LiDAR and Imagery Survey by Matrix System"
Case "2518004"
TextBox1.Text = "Proposed Campus Masterplan in Mangalore, India for Nitte University"
Case "1517007"
TextBox1.Text = "RAPID Environmental Audit"
Case "3114003-VO.2"
TextBox1.Text = "OE Manjung 5 Coal Fired Plant for the IF Works"
Case "3117009"
TextBox1.Text = "OE Kedah 1200MW Combined Cycle Power Plant"
Case "3911014-VO2"
TextBox1.Text = "Airasia House - Roof Enhancement Works"
Case "3216W01"
TextBox1.Text = "Design Review and Construction Supervision for Balochistan Highway"
Case "1213019"
TextBox1.Text = "C&S Mixed Development at Lot 12, Section 52, PJ"
Case "3915026"
TextBox1.Text = "C&S M&E Rapid UIO EPCC Of Substation Packages"
Case "7016001"
TextBox1.Text = "LRT 3 - Eastern"
Case "1217026"
TextBox1.Text = "C&S Springhill Port Dickson"
Case Else
MsgBox "Please Select Project Code"
End Select
End Sub
Sub CommandButton2_Click()
ProjectCodes = ComboBox1.Text
Select Case ProjectCodes
Case "999999"
TextBox1.Text = "General"
Item.Subject = Subject.Text + "[999999]"+ "[" + TextBox1.Text + "]"
Stop
Case "2017004"
TextBox1.Text = "IMW Waste based Biogas Power Plant at Sg Bakap, Penang"
Item.Subject = Subject.Text + "[2017004]"+ "[" + TextBox1.Text + "]"
Case "3116008"
TextBox1.Text = "OE Upgradation of Sirajganj Power Plant 3rd Unit Dual Fuel"
Item.Subject = Subject.Text + "[3116008]"+ "[" + TextBox1.Text + "]"
Case "1317023"
TextBox1.Text = "C&S Cadangan Pembangunan Springhill Clubhouse, Port Dickson"
Item.Subject = Subject.Text + "[1317023]"+ "[" + TextBox1.Text + "]"
Case "GDS0132"
TextBox1.Text = "Airborne LiDAR and Imagery Survey by Matrix System"
Item.Subject = Subject.Text + "[GDS0132]"+ "[" + TextBox1.Text + "]"
Case "2518004"
TextBox1.Text = "Proposed Campus Masterplan in Mangalore, India for Nitte University"
Item.Subject = Subject.Text + "[2518004]"+ "[" + TextBox1.Text + "]"
Case "1517007"
TextBox1.Text = "RAPID Environmental Audit"
Item.Subject = Subject.Text + "[1517007]"+ "[" + TextBox1.Text + "]"
Case "3114003-VO.2"
TextBox1.Text = "OE Manjung 5 Coal Fired Plant for the IF Works"
Item.Subject = Subject.Text + "[3114003-VO.2]"+ "[" + TextBox1.Text + "]"
Case "3117009"
TextBox1.Text = "OE Kedah 1200MW Combined Cycle Power Plant"
Item.Subject = Subject.Text + "[3117009]"+ "[" + TextBox1.Text + "]"
Case "3911014-VO2"
TextBox1.Text = "Airasia House - Roof Enhancement Works"
Item.Subject = Subject.Text + "[3911014-VO2]"+ "[" + TextBox1.Text + "]"
Case "3216W01"
TextBox1.Text = "Design Review and Construction Supervision for Balochistan Highway"
Item.Subject = Subject.Text + "[3216W01]"+ "[" + TextBox1.Text + "]"
Case "1213019"
TextBox1.Text = "C&S Mixed Development at Lot 12, Section 52, PJ"
Item.Subject = Subject.Text + "[1213019]"+ "[" + TextBox1.Text + "]"
Case "3915026"
TextBox1.Text = "C&S M&E Rapid UIO EPCC Of Substation Packages"
Item.Subject = Subject.Text + "[3915026]"+ "[" + TextBox1.Text + "]"
Case "7016001"
TextBox1.Text = "LRT 3 - Eastern"
Item.Subject = Subject.Text + "[7016001]"+ "[" + TextBox1.Text + "]"
Case "1217026"
TextBox1.Text = "C&S Springhill Port Dickson"
Item.Subject = Subject.Text + "[1217026]"+ "[" + TextBox1.Text + "]"
Case Else
MsgBox "Please Select Project Code"
End Select
End Sub
Sub Item_Open()
Set FormPage = Item.GetInspector.ModifiedFormPages("Message")
Set ComboBox1 = FormPage.Controls("ComboBox1")
Set TextBox1 = FormPage.Controls("TextBox1")
Set Subject = FormPage.Controls("Subject")
ComboBox1.AddItem "999999"
ComboBox1.AddItem "2017004"
ComboBox1.AddItem "3116008"
ComboBox1.AddItem "1317023"
ComboBox1.AddItem "GDS0132"
ComboBox1.AddItem "2518004"
ComboBox1.AddItem "1517007"
ComboBox1.AddItem "3114003-VO.2"
ComboBox1.AddItem "3117009"
ComboBox1.AddItem "3911014-VO2"
ComboBox1.AddItem "3216W01"
ComboBox1.AddItem "1213019"
ComboBox1.AddItem "3915026"
ComboBox1.AddItem "7016001"
ComboBox1.AddItem "1217026"
End Sub
Sub Label3_Click()
Set objWeb = CreateObject("InternetExplorer.Application")
objWeb.Navigate Item.GetInspector.ModifiedFormPages _
("Message").Controls("Label3").Caption
objWeb.Visible = True
End Sub
Sub CommandButton1_Click()
TextBox1.Text = ""
ComboBox1.Text= ""
Item.Subject = ""
End Sub
This is the code that I have right now. Everthing working fine untill when I received the sent email. The email wont automatically open like normal message, instead it will display it as attached file.
This is the custom form.
I'm trying to send the email.
received email will need to click it before can read it. I want to display it as normal message instead of attachement.
This is my current code :
Dim ComboBox1
Dim TextBox1
Dim Subject
Sub ComboBox1_Click()
ProjectCodes = ComboBox1.Text
Select Case ProjectCodes
Case "999999"
TextBox1.Text = "General"
Case "2017004"
TextBox1.Text = "IMW Waste based Biogas Power Plant at Sg Bakap, Penang"
Case "3116008"
TextBox1.Text = "OE Upgradation of Sirajganj Power Plant 3rd Unit Dual Fuel"
Case "1317023"
TextBox1.Text = "C&S Cadangan Pembangunan Springhill Clubhouse, Port Dickson"
Case "GDS0132"
TextBox1.Text = "Airborne LiDAR and Imagery Survey by Matrix System"
Case "2518004"
TextBox1.Text = "Proposed Campus Masterplan in Mangalore, India for Nitte University"
Case "1517007"
TextBox1.Text = "RAPID Environmental Audit"
Case "3114003-VO.2"
TextBox1.Text = "OE Manjung 5 Coal Fired Plant for the IF Works"
Case "3117009"
TextBox1.Text = "OE Kedah 1200MW Combined Cycle Power Plant"
Case "3911014-VO2"
TextBox1.Text = "Airasia House - Roof Enhancement Works"
Case "3216W01"
TextBox1.Text = "Design Review and Construction Supervision for Balochistan Highway"
Case "1213019"
TextBox1.Text = "C&S Mixed Development at Lot 12, Section 52, PJ"
Case "3915026"
TextBox1.Text = "C&S M&E Rapid UIO EPCC Of Substation Packages"
Case "7016001"
TextBox1.Text = "LRT 3 - Eastern"
Case "1217026"
TextBox1.Text = "C&S Springhill Port Dickson"
Case Else
MsgBox "Please Select Project Code"
End Select
End Sub
Sub CommandButton2_Click()
ProjectCodes = ComboBox1.Text
Select Case ProjectCodes
Case "999999"
TextBox1.Text = "General"
Item.Subject = Subject.Text + "[999999]"+ "[" + TextBox1.Text + "]"
Stop
Case "2017004"
TextBox1.Text = "IMW Waste based Biogas Power Plant at Sg Bakap, Penang"
Item.Subject = Subject.Text + "[2017004]"+ "[" + TextBox1.Text + "]"
Case "3116008"
TextBox1.Text = "OE Upgradation of Sirajganj Power Plant 3rd Unit Dual Fuel"
Item.Subject = Subject.Text + "[3116008]"+ "[" + TextBox1.Text + "]"
Case "1317023"
TextBox1.Text = "C&S Cadangan Pembangunan Springhill Clubhouse, Port Dickson"
Item.Subject = Subject.Text + "[1317023]"+ "[" + TextBox1.Text + "]"
Case "GDS0132"
TextBox1.Text = "Airborne LiDAR and Imagery Survey by Matrix System"
Item.Subject = Subject.Text + "[GDS0132]"+ "[" + TextBox1.Text + "]"
Case "2518004"
TextBox1.Text = "Proposed Campus Masterplan in Mangalore, India for Nitte University"
Item.Subject = Subject.Text + "[2518004]"+ "[" + TextBox1.Text + "]"
Case "1517007"
TextBox1.Text = "RAPID Environmental Audit"
Item.Subject = Subject.Text + "[1517007]"+ "[" + TextBox1.Text + "]"
Case "3114003-VO.2"
TextBox1.Text = "OE Manjung 5 Coal Fired Plant for the IF Works"
Item.Subject = Subject.Text + "[3114003-VO.2]"+ "[" + TextBox1.Text + "]"
Case "3117009"
TextBox1.Text = "OE Kedah 1200MW Combined Cycle Power Plant"
Item.Subject = Subject.Text + "[3117009]"+ "[" + TextBox1.Text + "]"
Case "3911014-VO2"
TextBox1.Text = "Airasia House - Roof Enhancement Works"
Item.Subject = Subject.Text + "[3911014-VO2]"+ "[" + TextBox1.Text + "]"
Case "3216W01"
TextBox1.Text = "Design Review and Construction Supervision for Balochistan Highway"
Item.Subject = Subject.Text + "[3216W01]"+ "[" + TextBox1.Text + "]"
Case "1213019"
TextBox1.Text = "C&S Mixed Development at Lot 12, Section 52, PJ"
Item.Subject = Subject.Text + "[1213019]"+ "[" + TextBox1.Text + "]"
Case "3915026"
TextBox1.Text = "C&S M&E Rapid UIO EPCC Of Substation Packages"
Item.Subject = Subject.Text + "[3915026]"+ "[" + TextBox1.Text + "]"
Case "7016001"
TextBox1.Text = "LRT 3 - Eastern"
Item.Subject = Subject.Text + "[7016001]"+ "[" + TextBox1.Text + "]"
Case "1217026"
TextBox1.Text = "C&S Springhill Port Dickson"
Item.Subject = Subject.Text + "[1217026]"+ "[" + TextBox1.Text + "]"
Case Else
MsgBox "Please Select Project Code"
End Select
End Sub
Sub Item_Open()
Set FormPage = Item.GetInspector.ModifiedFormPages("Message")
Set ComboBox1 = FormPage.Controls("ComboBox1")
Set TextBox1 = FormPage.Controls("TextBox1")
Set Subject = FormPage.Controls("Subject")
ComboBox1.AddItem "999999"
ComboBox1.AddItem "2017004"
ComboBox1.AddItem "3116008"
ComboBox1.AddItem "1317023"
ComboBox1.AddItem "GDS0132"
ComboBox1.AddItem "2518004"
ComboBox1.AddItem "1517007"
ComboBox1.AddItem "3114003-VO.2"
ComboBox1.AddItem "3117009"
ComboBox1.AddItem "3911014-VO2"
ComboBox1.AddItem "3216W01"
ComboBox1.AddItem "1213019"
ComboBox1.AddItem "3915026"
ComboBox1.AddItem "7016001"
ComboBox1.AddItem "1217026"
End Sub
Sub Label3_Click()
Set objWeb = CreateObject("InternetExplorer.Application")
objWeb.Navigate Item.GetInspector.ModifiedFormPages _
("Message").Controls("Label3").Caption
objWeb.Visible = True
End Sub
Sub CommandButton1_Click()
TextBox1.Text = ""
ComboBox1.Text= ""
Item.Subject = ""
End Sub