Patriot2879
Well-known Member
- Joined
- Feb 1, 2018
- Messages
- 1,259
- Office Version
- 2010
- Platform
- Windows
Hi wondering if you can help me please with the code in BOLD, i am trying to grab the data from 'Work Issue' sheet from A1 to I then down to last, but it doesnt seem to be grabbing it and pasting into my email, everything else works apart from the little bit of code in bold, please can you help me? thanks for your time
HTML:
Private Sub CommandButton1_Click()
Const PR_SECURITY_FLAGS = "http://schemas.microsoft.com/mapi/proptag/0x6E010003"
Dim aOutlook As Object
Dim aEmail As Object
Dim ulFlags As Integer
Dim rngeAddresses As Range, rngeCell As Range, strRecipients As String
Dim rngDataToEmail As Range
Set aOutlook = CreateObject("Outlook.Application")
Set aEmail = aOutlook.CreateItem(0)
With Sheets("Work Issue")
Set rngDataToEmail = .Range("A1:I" & .Range("A" & Rows.Count).End(xlUp).Row)
End With
ulFlags = ulFlags Or &H1 ' SECFLAG_ENCRYPTED
aEmail.PropertyAccessor.SetProperty PR_SECURITY_FLAGS, (ulFlags)
aEmail.HTMLBody = "<html>******>" & _
"<p>Hi " & Me.TextBox35.Value & "</p>" & _
"<p>" & Me.TextBox33.Value & "</p>" & _
"<p>" & Me.TextBox17.Value & "</p>" & _
"<table border=""1"", cellpadding=""10"", style=background:""#a6bbde"" >" & _
"<tr>" & _
"<th>Date:</th>" & _
"<td>" & Me.TextBox18.Text & "</td><td>" & Me.TextBox19.Text & "</td>" & _
"<td>" & Me.TextBox21.Text & "</td><td>" & Me.TextBox23.Text & "</td>" & _
"<td>" & Me.TextBox25.Text & "</td><td>" & Me.TextBox26.Text & "</td>" & _
"</tr>" & _
"<tr>" & _
"<th>Area:</th>" & _
"<td>" & Me.TextBox9.Value & "</td><td>" & Me.TextBox20.Value & "</td>" & _
"<td>" & Me.TextBox22.Value & "</td><td>" & Me.TextBox24.Value & "</td>" & _
"<td>" & Me.TextBox29.Value & "</td><td>" & Me.TextBox30.Value & "</td>" & _
"</tr>" & _
"</table>" & _
"<br><br><br><br><br><br>" & _
"<p>Many Thanks</p>" & _
"<p>Complex Team</p>" & _
"</body></html>"
aEmail.Recipients.Add (UserForm1.TextBox36.Value)
aEmail.CC = (UserForm1.TextBox37.Value)
aEmail.BCC = ""
aEmail.Subject = "Weekly " & Range("D2").Value & (UserForm1.TextBox39.Value)
aEmail.Display
[code]
[/code]
Unload Me
End Sub