Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Dates in Excel linked with Outlook Calendar
Is there a way to link dates from an Excel spreadsheet to an Outlook
Calendar? I would like to have reminders in my Calendar for times when I want to send out Marketing materials. Thanks in advance. |
#2
|
|||
|
|||
Use code such as shown below
Sub AddToOutlook() Dim o As Outlook.Application Dim ai As Outlook.AppointmentItem Set o = GetObject(, "Outlook.Application") Set ai = o.CreateItem(olAppointmentItem) ai.Body = "Do abc" ai.Subject = "Things to do" ai.Start = "05/19/05 04:00:00 PM" ai.Duration = 30 ai.Close olSave End Sub Alok Joshi "itsupport@cthomes" wrote: Is there a way to link dates from an Excel spreadsheet to an Outlook Calendar? I would like to have reminders in my Calendar for times when I want to send out Marketing materials. Thanks in advance. |
#3
|
|||
|
|||
Thanks for your response, but can you walk me through the steps to add this
code into the program. I don't know much about computer programing and such. Thanks again. "Alok" wrote: Use code such as shown below Sub AddToOutlook() Dim o As Outlook.Application Dim ai As Outlook.AppointmentItem Set o = GetObject(, "Outlook.Application") Set ai = o.CreateItem(olAppointmentItem) ai.Body = "Do abc" ai.Subject = "Things to do" ai.Start = "05/19/05 04:00:00 PM" ai.Duration = 30 ai.Close olSave End Sub Alok Joshi "itsupport@cthomes" wrote: Is there a way to link dates from an Excel spreadsheet to an Outlook Calendar? I would like to have reminders in my Calendar for times when I want to send out Marketing materials. Thanks in advance. |
#4
|
|||
|
|||
If you have not done any VBA programming then I am not sure if this should be
your first project. However the steps are 1. You will have to switch to the Visual Basic Integrated Development Environment (in simple words, where you write your code) and select Tools/References and in the list that you see you will select Microsoft Outlook 9.0 Library. 2. You then insert a Module and type in the code that I presented earlier. 3. You should be able to run the code by clicking anywhere in the code and pressing F5. When you do this, your Outlook Application should be open. You then go and switch to Outlook to make sure that an appointment was added. 4. The above steps demonstrate that the code is working. 5. Now your challenge is to take the data from excel and use that to create the Appointments You do this by Code such as this Dim r&,sSubject$,sBody$,dStartTime as Date,dDuration# for r = 2 to 50 'Assuming that Subject is in column A sSubject = Sheet1.Cells(r,1).value 'Assuming that Body is in Column B sBody = Sheet1.Cells(r,2).value 'Assuming that Start Date and Time is in Column C dStartTime = Sheet1.Cells(r,3).value 'Assuming that Duration is in Column D dDuration = Sheet1.Cells(r,4).value Set ai = o.CreateItem(olAppointmentItem) ai.Body = sBody ai.Subject = sSubject ai.Start = dStartTime ai.Duration = dDuration ai.Close olSave Next r Basically you use the same code as shown earlier but replace the code for single Appointment creation with the loop shown above. Hope this is clear. Alok Joshi "itsupport@cthomes" wrote: Thanks for your response, but can you walk me through the steps to add this code into the program. I don't know much about computer programing and such. Thanks again. "Alok" wrote: Use code such as shown below Sub AddToOutlook() Dim o As Outlook.Application Dim ai As Outlook.AppointmentItem Set o = GetObject(, "Outlook.Application") Set ai = o.CreateItem(olAppointmentItem) ai.Body = "Do abc" ai.Subject = "Things to do" ai.Start = "05/19/05 04:00:00 PM" ai.Duration = 30 ai.Close olSave End Sub Alok Joshi "itsupport@cthomes" wrote: Is there a way to link dates from an Excel spreadsheet to an Outlook Calendar? I would like to have reminders in my Calendar for times when I want to send out Marketing materials. Thanks in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Stop Excel Rounding Dates | Excel Discussion (Misc queries) | |||
How do I export email addresses from excel to outlook? | Excel Discussion (Misc queries) | |||
How do I link to an Outlook public folder from an Excel spreadshe. | Excel Discussion (Misc queries) | |||
Ploting dates against a calendar and not as a simple events | Charts and Charting in Excel | |||
Excel and OUTLOOK | Excel Discussion (Misc queries) |