How add a range of data o OLAppointment.Body

mecerrato

Board Regular
Joined
Oct 5, 2015
Messages
184
Office Version
  1. 365
Platform
  1. Windows
I have this routine that works perfectly fine. The issue is that under the part of OLAppointment.Body I am referencing many cells and need to do more.
So I have rearranged my data so all of the data I want to include in OLAppointment.Body is in range Worksheets("Manager County Info").Range("D7:I17") but I don't know how to code OLAppointment.Body to accept a range.

Anyone know how I can do this?

I posted this on stackoverflow but have not received a solution :-(

VBA Code:
Sub Appointments()
Const olAppointmentItem As Long = 1
Dim olApp As Object
Dim OLNS As Object
Dim OLAppointment As Object
Call GetData
formattedHTHLL = Format(ActiveSheet.Range("R" & ActiveCell.Row).value, "$#,##0")
formattedBond2LL = Format(ActiveSheet.Range("S" & ActiveCell.Row).value, "$#,##0")
formattedBond3LL = Format(ActiveSheet.Range("T" & ActiveCell.Row).value, "$#,##0")
formattedBondSP = Format(ActiveSheet.Range("U" & ActiveCell.Row).value, "$#,##0")
formattedTaxes = Format(ActiveSheet.Range("E7").value, "$#,##0")
formattedSellerStamps = Format(ActiveSheet.Range("E8").value, "$#,##0")
formattedCredit = Format(ActiveSheet.Range("E4").value, "$#,##0")
formattedDownPayment = Format(ActiveSheet.Range("G6").value, "$#,##0")

Worksheets("Manager County Info").Range("D7").value = Worksheets("Loans").Range("I" & ActiveCell.Row).value
On Error Resume Next
Set olApp = GetObject(, "Outlook.Application")
If olApp Is Nothing Then Set olApp = CreateObject("Outlook.Application")
On Error GoTo 0

If Not olApp Is Nothing Then

    Set OLNS = olApp.GetNamespace("MAPI")
    OLNS.Logon

    Set OLAppointment = olApp.CreateItem(olAppointmentItem)
    OLAppointment.Subject = Worksheets("Loans").Range("B" & ActiveCell.Row).value & " (LGI 
    Builder LO - " & Worksheets("Loans").Range("K" & ActiveCell.Row).value & ")" _
    & " COE " & Worksheets("Loans").Range("W" & ActiveCell.Row).value & " (" & 
    Worksheets("Loans").Range("Q" & ActiveCell.Row).value & ")"
    OLAppointment.Start = Worksheets("Loans").Range("M" & ActiveCell.Row).value & " " & 
    Format(Worksheets("Loans").Range("O" & ActiveCell.Row).value, "h:mm")
    OLAppointment.Body = Worksheets("Loans").Range("I" & ActiveCell.Row).value & " County " & 
    vbNewLine & "HTH Income Limit " & formattedHTHLL & vbNewLine & _
        "FHA Bond 1-2 Household Income Limit " & formattedBond2LL & vbNewLine & "FHA Bond 3-4 
    Household Income Limit " & formattedBond3LL & vbNewLine & _
        "FHA Bond Sales Price limit " & formattedBondSP & vbNewLine & "Taxes " & 
    formattedTaxes & vbNewLine & "Seller Stamps " & formattedSellerStamps & _
        vbNewLine & "Builder Credit " & formattedCredit & vbNewLine & "Contract Date " & 
    Worksheets("Loans").Range("L" & ActiveCell.Row).value & vbNewLine & "Contract Commitment 
    Date: " & Worksheets("Loans").Range("G7").value & vbNewLine & "Estimated Down Payment: " & 
    _
    formattedDownPayment & vbNewLine & vbNewLine
        
    OLAppointment.Location = "Borrower Cell"
    OLAppointment.Duration = 90
    OLAppointment.ReminderMinutesBeforeStart = 180
    OLAppointment.Display

    Set OLAppointment = Nothing
    Set OLNS = Nothing
    Set olApp = Nothing
End If

End Sub
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Forum statistics

Threads
1,224,825
Messages
6,181,189
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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