Excel, Outlook integration

  • Thread starter Thread starter OVS
  • Start date Start date
O

OVS

I writing this on behalf of someone who needs to integrate information
between Excel and Outlook.

What he wants is for outlook to 'take' the due date of rental income from
an Excel worksheet and place it in the Calender of Outlook.

Is this possible?

thank you
 
This requires some knowledge of VBA. Here is some Code to help get yo
started. You will probably need to modify my code for your specifi
needs (loops, if statements, etc.) The code below assumes that yo
have the RENT DUE DATE in Cell A2 of the worksheet, The PROPERT
DESCRIPTION in Range B2, and the AMOUNT DUE in Range C2. Each ne
appointment date that is created uses a date variable which will chang
depending on the cell value in the workbook (Column A) but has a har
coded start time of 12:00 pm for all appointments. Good luck and jus
let us know if you need any more help!

YOU WILL NEED TO ADD REFERENCE TO MICROSOFT OUTLOOK OBJECT LIBRARY I
YOUR EXCEL PROJECT!!!

Dim oApp As Object
Dim oNameSpace As NameSpace
Dim oFolder As Object
Dim myItem As AppointmentItem
Dim vDate As String
Dim vProperty As String
Dim vRent As String

Public Sub AddApointments()

vDate = Range("A2").Value
vProperty = Range("B2").Value
vRent = Range("C2").Value

Set oApp = New Outlook.Application
Set oNameSpace = oApp.GetNamespace("MAPI")

Set oFolder = oNameSpace.Folders(2).Folders("calendar")
Set myItem = oApp.CreateItem(olAppointmentItem)

myItem.Subject = "Rent Due for " & vProperty & " $" & vRent
myItem.Start = vDate & " 12:00:00 PM"
myItem.Duration = 90
myItem.Save


End Sub






Rolli
 
This requires some knowledge of VBA. Here is some Code to help get you
started. You will probably need to modify my code for your specific
needs (loops, if statements, etc.) The code below assumes that you
have the RENT DUE DATE in Cell A2 of the worksheet, The PROPERTY
DESCRIPTION in Range B2, and the AMOUNT DUE in Range C2. Each new
appointment date that is created uses a date variable which will change
depending on the cell value in the workbook (Column A) but has a hard
coded start time of 12:00 pm for all appointments. Good luck and just
let us know if you need any more help!

YOU WILL NEED TO ADD REFERENCE TO MICROSOFT OUTLOOK OBJECT LIBRARY IN
YOUR EXCEL PROJECT!!!

Dim oApp As Object
Dim oNameSpace As NameSpace
Dim oFolder As Object
Dim myItem As AppointmentItem
Dim vDate As String
Dim vProperty As String
Dim vRent As String

Public Sub AddApointments()

vDate = Range("A2").Value
vProperty = Range("B2").Value
vRent = Range("C2").Value

Set oApp = New Outlook.Application
Set oNameSpace = oApp.GetNamespace("MAPI")

Set oFolder = oNameSpace.Folders(2).Folders("calendar")
Set myItem = oApp.CreateItem(olAppointmentItem)

myItem.Subject = "Rent Due for " & vProperty & " $" & vRent
myItem.Start = vDate & " 12:00:00 PM"
myItem.Duration = 90
myItem.Save


End Sub

wow, thanks for that Rollin. From first glance it looks way beyond my
knowledge! But it does look very interesting. Hopefully I'll be able to at
least give it a go.


Thanks again
 
No problem. I can help you go through all the steps if you need. I
really shouldn't take but a few minutes to accomplish what you want
Can you post a portion of the Excel Workbook so I can see the exac
format of each of the records? It's not really that hard and I don'
mind helping so don't worry....that's what these forums are for :)


Rolli
 
Back
Top