+ Reply to Thread
Results 1 to 4 of 4

Dates in Excel linked with Outlook Calendar

  1. #1
    itsupport@cthomes
    Guest

    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. #2
    Alok
    Guest

    RE: Dates in Excel linked with Outlook Calendar

    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. #3
    itsupport@cthomes
    Guest

    RE: Dates in Excel linked with Outlook Calendar

    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. #4
    Alok
    Guest

    RE: Dates in Excel linked with Outlook Calendar

    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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1