Evening all
I have a user form which prior to my company upgrading to Windows 7 from XP worked perfectly, we're using Office 2010
The outlook mail previously populated the contents of the user form, added the distribution list, mail title, body of the mail and also the auto signature of whoever was using it
Now it does everything bar add the auto sig. From memory and my basic understanding, the .display prior to .to = MailList meant this was possible, the majority of code was taken from Ron de Bruin's code and adapted to suit
Can anyone see anything within the code that would cause this or have any suggestions to fix?
Many thanks
I have a user form which prior to my company upgrading to Windows 7 from XP worked perfectly, we're using Office 2010
The outlook mail previously populated the contents of the user form, added the distribution list, mail title, body of the mail and also the auto signature of whoever was using it
Now it does everything bar add the auto sig. From memory and my basic understanding, the .display prior to .to = MailList meant this was possible, the majority of code was taken from Ron de Bruin's code and adapted to suit
Can anyone see anything within the code that would cause this or have any suggestions to fix?
Many thanks
Code:
Sub EmailMeNewVDN()
Dim Cell As Range
Dim MailList As Variant
Dim Rng As Range
Dim Wks As Worksheet
Dim OlApp As Object
Dim O1Mail As Object
Dim OlNS As Object
Dim HTMLbody As String
Set Wks = Workbooks("Change Notification Form 5.0.xlsm").Sheets("Email List")
Set Rng = Wks.Range("A1", Wks.Cells(Rows.Count, "A").End(xlUp))
For Each Cell In Rng
MailList = MailList & Cell.Value & ";"
Next Cell
Set OlApp = CreateObject("Outlook.Application")
Set OlNS = OlApp.Session.GetDefaultFolder(6)
Dim iOrderIT As String, iCustomer As String, iText34 As String, iChangeType As String
Dim iArea1 As String, iArea2 As String, iText29 As String, iText4 As String, iText5 As String, iText8 As String, iText9 As String
Dim iText12 As String, iComboBox3 As String
iOrderIT = UserFormChangeNotification.TextBox1.Text
iCustomer = UserFormChangeNotification.TextBox2.Text
iText34 = UserFormChangeNotification.TextBox34.Text
iChangeType = UserFormChangeNotification.ComboBox1.Text
iArea1 = UserFormChangeNotification.ComboBox2.Text
iArea2 = UserFormChangeNotification.ComboBox3.Text
iText4 = UserFormChangeNotification.TextBox4.Text
iText5 = UserFormChangeNotification.TextBox5.Text
iText8 = UserFormChangeNotification.TextBox8.Text
iText9 = UserFormChangeNotification.TextBox9.Text
iText12 = UserFormChangeNotification.TextBox12.Text
iText29 = UserFormChangeNotification.TextBox29.Text
iComboBox3 = UserFormChangeNotification.ComboBox3.Text
HTMLbody = "<FONT color=#000000 face=Arial size=2>" & "Hello all" & "<br>" & "<br>" & "Please find below details of a scheduled change" _
& "<br>" & "<br>" & "OrderIT Reference :" & " " & iOrderIT _
& "<br>" & "Customer :" & " " & iCustomer _
& "<br>" & "<b>Scheduled Change Date :</b>" & " " & iText34 _
& "<br>" _
& "<br>" & "<b>Change Type :</b>" & " " & iChangeType _
& "<br>" _
& "<br>" & "Area :" & " " & iArea1 _
& "<br>" & "VDN Number :" & " " & iText29 _
& "<br>" & "VDN Name :" & " " & iText4 _
& "<br>" & "Parent Group :" & " " & iText5 _
& "<br>" _
& "<br>" & "<b>Additional Information :</b>" _
& "<br>" & iText12 _
& "<br>" _
& "<br>" & "Please email <A href=mailto:$TB%20-%20Telephony%20Routing%20Support%20&%20Solutions>$TB - Telephony Routing Support & Solutions</A> if you wish to unsubscribe" _
& "<br>" _
& "<br>" & "Many thanks"
With OlApp.CreateItem(0)
.display
.to = MailList
.CC = ""
.BCC = ""
.Subject = "Telephony Routing Change Notification" & " " & "-" & " " & "New VDN"
.HTMLbody = HTMLbody
.display
End With
Set OlMail = Nothing
Set OlApp = Nothing
End Subv