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

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Forum statistics

Threads
1,223,911
Messages
6,175,335
Members
452,636
Latest member
laura12345

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