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
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
How add a range of data o OLAppointment.Body
I have this routine that works perfectly fine. The issue is that under the part of OLAppointment.Body I am referencing many cells but I have rearranged my data so all of the data I want to include in
stackoverflow.com
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