jcgraham0007
New Member
- Joined
- Jun 21, 2020
- Messages
- 10
- Office Version
- 2016
- 2013
- 2010
- 2007
- Platform
- Windows
Can anyone help. I've created a userform and everything functions as it should.
However when I send the email using the command button, the email arrives buts is missing any listbox information.
I've created a formula which will display cell data based on a range in a worksheet.
I've done similar with combobox drop down boxes and the data arrives fine.
The email is sent as plain text but whatever I try I can't get listbox info to show
My Code as follows
Private Sub CommandButton2_Click()
Dim aOutlook As Object
Dim aEmail As Object
Dim rngeAddresses As Range, rngeCell As Range, strRecipients As String
Set aOutlook = CreateObject("Outlook.Application")
Set aEmail = aOutlook.CreateItem(0)
'set Importance
aEmail.Importance = 1
'Set Subject
aEmail.Subject = "Planned Lock Request Change"
'Set Body for mail
aEmail.Body = "Promised Delivery Date: " & Me.TextBox1.Value & Chr(10) & _
"Person Making the Request: " & Me.ComboBox1.Value & Chr(10) & _
"Reason For Making the Request: " & Me.ComboBox2.Value & Chr(10) & _
"Customer Name: " & Me.ComboBox3.Value & Chr(10) & _
"Order Number: " & Me.TextBox8.Value & Chr(10) & _
"Customer Tier Level: " & Me.TextBox2.Value & Chr(10) & _
"Total Cost of the Order: " & Me.TextBox3.Value & Chr(10) & _
"Product Code: " & Me.ComboBox6.Value & Chr(10) & _
"Product Name and Pack Size: " & Me.ListBox2.Value & Chr(10) & _
"Quantity: " & Me.TextBox5.Value & Chr(10) & _
"Product Code: " & Me.ComboBox7.Value & Chr(10) & _
"Product Name and Pack Size: " & Me.ListBox3.Value & Chr(10) & _
"Quantity: " & Me.TextBox6.Value & Chr(10) & _
"Product Code: " & Me.ComboBox8.Value & Chr(10) & _
"Product Name and Pack Size: " & Me.ListBox4.Value & Chr(10) & _
"Quantity: " & Me.TextBox7.Value & Chr(10) & _
"Notes: " & Me.TextBox4.Value
'send one off to 1 person use this static code
'aEmail.Recipients.Add " "
aEmail.Recipients.Add " "
'Send Mail
aEmail.Send
End Sub
Thanks in Advance
However when I send the email using the command button, the email arrives buts is missing any listbox information.
I've created a formula which will display cell data based on a range in a worksheet.
I've done similar with combobox drop down boxes and the data arrives fine.
The email is sent as plain text but whatever I try I can't get listbox info to show
My Code as follows
Private Sub CommandButton2_Click()
Dim aOutlook As Object
Dim aEmail As Object
Dim rngeAddresses As Range, rngeCell As Range, strRecipients As String
Set aOutlook = CreateObject("Outlook.Application")
Set aEmail = aOutlook.CreateItem(0)
'set Importance
aEmail.Importance = 1
'Set Subject
aEmail.Subject = "Planned Lock Request Change"
'Set Body for mail
aEmail.Body = "Promised Delivery Date: " & Me.TextBox1.Value & Chr(10) & _
"Person Making the Request: " & Me.ComboBox1.Value & Chr(10) & _
"Reason For Making the Request: " & Me.ComboBox2.Value & Chr(10) & _
"Customer Name: " & Me.ComboBox3.Value & Chr(10) & _
"Order Number: " & Me.TextBox8.Value & Chr(10) & _
"Customer Tier Level: " & Me.TextBox2.Value & Chr(10) & _
"Total Cost of the Order: " & Me.TextBox3.Value & Chr(10) & _
"Product Code: " & Me.ComboBox6.Value & Chr(10) & _
"Product Name and Pack Size: " & Me.ListBox2.Value & Chr(10) & _
"Quantity: " & Me.TextBox5.Value & Chr(10) & _
"Product Code: " & Me.ComboBox7.Value & Chr(10) & _
"Product Name and Pack Size: " & Me.ListBox3.Value & Chr(10) & _
"Quantity: " & Me.TextBox6.Value & Chr(10) & _
"Product Code: " & Me.ComboBox8.Value & Chr(10) & _
"Product Name and Pack Size: " & Me.ListBox4.Value & Chr(10) & _
"Quantity: " & Me.TextBox7.Value & Chr(10) & _
"Notes: " & Me.TextBox4.Value
'send one off to 1 person use this static code
'aEmail.Recipients.Add " "
aEmail.Recipients.Add " "
'Send Mail
aEmail.Send
End Sub
Thanks in Advance