![]() |
Macro to create a Outlook Appointment from excel cell data
Hi,
I need an excel macro which when run will use cell data to create an Outlook Appointment with a reminder. Ie A1 Customer Name A2 Appointment Date A3 Appointment Time A4 Reminder Time etc etc Can anyone help Thanks, Scratchy Head Alarmbloke |
Macro to create a Outlook Appointment from excel cell data
The example below pulls the 'start' property (date/time) of the appointment
item from column A and the 'location' property from column B and begins with Row 1 (no header row). It sounds like you will want to modify it to include more properties, possibly 'duration', 'ReminderMinutesBeforeStart', 'ReminderSet', 'RequiredAttendees' and possibly others. Before starting, press Alt plus F11, click 'Tools References' and set a reference to the Microsoft Outlook xx.0 Object Library (xx depends on your version of Office). Sub ScheduleAppts() Dim ol As New Outlook.Application Dim ns As Outlook.Namespace Dim olFolder As Outlook.MAPIFolder Dim appt As Outlook.AppointmentItem Dim R As Integer Dim X As Integer R = Range("A65536").End(xlUp).Row Set ns = ol.GetNamespace("MAPI") Set olFolder = ns.GetDefaultFolder(olFolderCalendar) For X = 1 To R Set appt = olFolder.Items.Add With appt .Start = Sheets("Sheet1").Cells(X, 1).Value .Location = Sheets("Sheet1").Cells(X, 2).Value .Save End With Next X Set ol = Nothing Set ns = Nothing Set appt = Nothing End Sub Steve "Alarmbloke" wrote in message ... Hi, I need an excel macro which when run will use cell data to create an Outlook Appointment with a reminder. Ie A1 Customer Name A2 Appointment Date A3 Appointment Time A4 Reminder Time etc etc Can anyone help Thanks, Scratchy Head Alarmbloke |
All times are GMT +1. The time now is 05:53 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com