Adding dropdown list using custom form

Status
Not open for further replies.

zulhairi

New Member
Outlook version
Email Account
Exchange Server
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.
1.png



I'm trying to send the email.

2.png



received email will need to click it before can read it. I want to display it as normal message instead of attachement.
3.png


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

It might be something the disclaimer is doing - the disclaimr is plain text. Can you test the code with an account that doesn't get the disclaimer added?

(I'm going to delete the other duplicate thread- this one is easier to read and review.)
 
Hi Diane,

Thanks for the reply, is there other way for me to do this. I'm just trying to display project codes + description at the end of subject field based on the dropdown selection. I'm still new to this outlook custom glad if u can help.

[You can delete the other duplicate post, sry for any inconvenience caused]
 
Hi Diane,

Thanks for the reply, is there other way for me to do this. I'm just trying to display project codes + description at the end of subject field based on the dropdown selection. I'm still new to this outlook custom glad if u can help.

[You can delete the other duplicate post, sry for any inconvenience caused]

Is there any way to populate combobox with textbox without using any code. Only use custom form
 
Is there any way to populate combobox with textbox without using any code. Only use custom form
As long as the values won't change, yes - on the properties page.


The instructions on Display a person's age in the subject of a custom form show how to use a field to set the subject field - no code needed to update the subject.

FWIW, if you need to use a macro, i think a userform would be better, but its not practical if you are distributing it to other users.

2018-06-07_0-04-40.png
 
As long as the values won't change, yes - on the properties page.


The instructions on Display a person's age in the subject of a custom form show how to use a field to set the subject field - no code needed to update the subject.

FWIW, if you need to use a macro, i think a userform would be better, but its not practical if you are distributing it to other users.

View attachment 2397
I'm thinking to use userform also instead of macro,

Can I populate each value of combobox with description without adding any codes.

For example :

If the user choose the value 1 at the combobox, it will display description of value 1 at the textbox.
If user choose value 2 at combobox, description of value 2 will display at combobox and so on.

1.png
 
If the user choose the value 1 at the combobox, it will display description of value 1 at the textbox.
If user choose value 2 at combobox, description of value 2 will display at combobox and so on.
I've found the solution,

I just need to create initial value for formula in the custom form.

IIf Function
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
R Adding Userform Dropdown List items from names of subfolders on network drive Outlook VBA and Custom Forms 10
Z Outlook Custom Form: Adding Dropdown(Project Code) at the end of subject Outlook VBA and Custom Forms 0
S Adding Custom Forms Outlook VBA and Custom Forms 4
G Adding a contact to a specific folder Using Outlook 0
S Adding a recipient's column to Sent folder in Outlook 2010 Outlook VBA and Custom Forms 1
G Stop Outlook 365 adding meetings to calendar Using Outlook 1
G Removing old emails when adding accounts Using Outlook 3
D Contact Group - Adding Bulk Addresses Using Outlook 2
C Outlook 2007 Removing then adding account restores junk email processing Using Outlook 0
J O365 - Adding Shared Google Calendar ICS link issue in O365 Using Outlook 0
B Adding signature to bottom of VBA reply email Outlook VBA and Custom Forms 1
S User Defined Fields adding new value (2) Using Outlook 0
M Changing the preferred order for "Put this entry in" list for adding new contacts to the Address Book Using Outlook 1
M Adding Subject to this Link-Saving VBA Outlook VBA and Custom Forms 5
E Project Management - Adding Folders for Different Folder Types Using Outlook.com accounts in Outlook 0
D Adding Enterprise Exchange Email Account to Outlook Prevents Sending via Outlook.com Account Using Outlook.com accounts in Outlook 10
S Adding new Exchange (2016) rule very slow down Microsoft Outlook Exchange Server Administration 0
M Adding Macro to populate "to" "subject" "body" not deleting email string below. Outlook VBA and Custom Forms 5
E Unable to open Outlook 2010 after adding new email account Using Outlook 4
O Adding a new account - "CompanyL (none)" line is added Using Outlook 5
broadbander Needing help with reply/reply all while keeping attachments and adding a new CC recipient. Outlook VBA and Custom Forms 5
M adding corresponding contact form data on a mass scale Using Outlook 5
A VB to "reply all" email items stored in a folder of outlook with adding a new message Outlook VBA and Custom Forms 0
K adding more rules to 'different domains check' macro Outlook VBA and Custom Forms 2
P MS OUTLOOK 2013 - Adding Sender on the CC line Using Outlook 5
R User Defined Fields adding new value Using Outlook 3
W Adding A Macro To Message Ribbon Outlook VBA and Custom Forms 2
I Collecting mail address from GAB and adding to Outlook Task Using Outlook 2
A Outlook 2016 - adding outlook.com account creates a new/strange address Using Outlook.com accounts in Outlook 18
F Adding textbox filter to listbox? Outlook VBA and Custom Forms 2
N Recurring invite sent w/distribution list adding/removing attendees Using Outlook 0
J Issues with adding iCloud to Outlook Using Outlook 1
G Adding a contact to Outlook with a custom form using Access VBA Outlook VBA and Custom Forms 1
C Macro to send email after changing from address and adding signature Outlook VBA and Custom Forms 1
J Adding Reply & Delete to main toolbar? Using Outlook 0
T Outlook 2007 adding categories Using Outlook 15
N Adding Appointment Item in Outlook to Shared Calendar Folder Outlook VBA and Custom Forms 7
Diane Poremsky Adding Emojis to Outlook's AutoCorrect Using Outlook 0
T Adding "Mark As Complete" btton to Task Remindet Pop-Up Using Outlook 3
O Saving Attachments to folder on disk and adding Initials to end of file name Outlook VBA and Custom Forms 9
Ascar_CT Adding contacts on Android phone and then syncing them to Outlook Using Outlook.com accounts in Outlook 4
A Adding a 2010 sharepoint contact list to outlook 2010 address book Using Outlook 1
M Adding fields to Task in Outlook Home and Business 2010 Outlook VBA and Custom Forms 7
S Using Send on Behalf is adding extra data in from line Using Outlook 1
Lucylou Outlook 2013 Adding Outlook.com breaks profile, "Outlook not working" messag Using Outlook.com accounts in Outlook 1
C Adding Categories when Composing Email Using Outlook 1
stephenjones Adding a business account to Outlook Using Outlook 1
Chris Grew Adding 2nd Email Address BCM (Business Contact Manager) 3
G Adding an attachment to email I just created (VBA) Outlook VBA and Custom Forms 1
tswatek Inbox problems after adding MS Exchange email Using Outlook 2

Similar threads

Back
Top