Formatting outlook body

aryanaveen

Board Regular
Joined
Jan 5, 2015
Messages
104
Hi All,

Please help me with below code, This code is creating a meeting invite, however body of email is coming as plain text, Is there a way to retain the format from excel file


Sub Setupinvite()
Dim OutApp As Object
Dim OutMail As Object
Dim cell As Range

Application.ScreenUpdating = True
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(1)
With OutMail
.MeetingStatus = olMeeting
.RequiredAttendees = Range("B2").Value
'.RequiredAttendees.Type = RequiredAttendees
.Subject = Range("B3").Value

If Range("B19").Value = "Yes" Then
.Body = Range("B6").Value & vbNewLine & vbNewLine & Range("B8").Value & _
vbNewLine & vbNewLine & Range("B10").Value & vbNewLine & vbNewLine & _
Range("C12").Value & vbNewLine & _
Range("C19").Value & vbNewLine & vbNewLine & "Note: Considering the current situation we are unable to book rooms for the call" & _
vbNewLine & vbNewLine & "Kind Regards,"

Else
.Body = Range("B6").Value & vbNewLine & vbNewLine & Range("B8").Value & _
vbNewLine & vbNewLine & Range("B10").Value & vbNewLine & vbNewLine & _
Range("C12").Value & vbNewLine & _
vbNewLine & vbNewLine & "Note: Considering the current situation we are unable to book rooms for the call" & _
vbNewLine & vbNewLine & "Kind Regards,"
End If


.Start = Range("C16").Value
.Location = "Skype call"
.Duration = 60 ' 1 hour meeting
.BusyStatus = 2 ' set as busy
.ReminderSet = True 'reminder set
.ReminderMinutesBeforeStart = "15" 'reminder 2 weeks before
.Attachments.Add
.Display
'.Send
End With

'Cells(cell.Row, "K").Value = "sent"
Set OutMail = Nothing


Application.ScreenUpdating = True
End Sub
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Forum statistics

Threads
1,214,983
Messages
6,122,598
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top