I have found several codes to create a calendar reminder and I have worked out one that should be perfect for me, but I have one problem.
The body of the calendar event needs to be everything in cell A1:I50 which includes a small logo picture. I have declared this as SBORDER, but the problem I have is what tpye of variable can I use for this? I have tried Object but it says I have not defined it using a "with" statement and I have tried Range, but I get the same error. I also tried String but it says that I can't use a range of cells as a String.
here is my code
Any help on this would be greatly appreciated as always.
Also a very helpful tip I found on this forum to anyone trying to use this function. You need to go to the VBA editor under tools and references then enable the Microsoft Outlook 12.0 Object Library or you will get a user type not defined error.
The body of the calendar event needs to be everything in cell A1:I50 which includes a small logo picture. I have declared this as SBORDER, but the problem I have is what tpye of variable can I use for this? I have tried Object but it says I have not defined it using a "with" statement and I have tried Range, but I get the same error. I also tried String but it says that I can't use a range of cells as a String.
here is my code
Code:
Function AddOutLookAppt()
Dim appOutLook As Outlook.Application
Dim ApptOutLook As Outlook.AppointmentItem
Dim STARDATE As Date
Dim ENDDATE As Date
Dim SBORDER As String
STARDATE = Range("E15").Value
ENDDATE = Range("E15").Value
SBORDER = Range("A1:I50").Value
Set appOutLook = CreateObject("Outlook.Application")
Set ApptOutLook = appOutLook.CreateItem(olAppointmentItem)
With ApptOutLook
.Start = STARTDATE
.End = ENDDATE
.AllDayEvent = True
.Subject = "Order Due in Two Days"
.Location = ""
.Body = SBORDER
.BusyStatus = olFree
.ReminderSet = True
.ReminderMinutesBeforeStart = 0
.Save
End With
End Function
Any help on this would be greatly appreciated as always.
Also a very helpful tip I found on this forum to anyone trying to use this function. You need to go to the VBA editor under tools and references then enable the Microsoft Outlook 12.0 Object Library or you will get a user type not defined error.