Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Updating Outlook Calendar from Excel

Hi All,

I am using the following code to add an appointment to Outlook from Excel:

Sub AddAppointmentsToCalendar()
Dim OLF As Outlook.MAPIFolder, objItem As Outlook.AppointmentItem
Dim i As Long, lngItemCount As Long, r As Long
On Error Resume Next
Set OLF = GetObject("",
"Outlook.Application").GetNamespace("MAPI").GetDef aultFolder(olFolderCalendar)
On Error GoTo 0
If OLF Is Nothing Then Exit Sub ' Outlook not available

Application.StatusBar = "Adding appointments to Outlook..."
With wsSheet1 ' the worksheet with the new appointments
.Activate
r = Range("NewAppointments").Row + 1 ' the first row with data
Do While Len(Range("A" & r).Formula) 0
On Error Resume Next
Set objItem = OLF.Items.Add(olAppointmentItem)
On Error GoTo 0
If Not objItem Is Nothing Then ' a new item is created
With objItem
.Start = Range("A" & r).Value
.End = Range("C" & r).Value
.Subject = Range("E" & r).Value
.Body = Range("F" & r).Value
.Categories = Range("G" & r).Value
.ReminderSet = True ' reminder
.Save ' the new item
End With
Set objItem = Nothing
End If
r = r + 1
Loop
End With
Application.StatusBar = False
End Sub

However, I would like to amend the code so that the start date for the
appointment is entered by the user in any
cell in column A starting in A7, the start time is entered in any cell in
column B starting in B7, the end date is entered
in any cell in column C starting at C7 and the end time is entered in any
cell in column D starting in D7.

Any ideas?

Thanks,

Steve


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel and outlook calendar Laurie Excel Discussion (Misc queries) 1 March 30th 09 05:11 AM
how do i export excel calendar info to outlook calendar? Maggie Excel Discussion (Misc queries) 1 December 31st 07 10:27 PM
dates from excel onto outlook calendar maureen Excel Discussion (Misc queries) 0 March 23rd 07 05:55 PM
Excel to Outlook Calendar Macro KurtB Excel Discussion (Misc queries) 0 November 7th 06 01:29 PM
import calendar items from excel into outlook calendar jsewaiseh Excel Discussion (Misc queries) 0 September 2nd 05 03:53 PM


All times are GMT +1. The time now is 04:54 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"