Thread: [Solved] CSV data to Outlook macro
View Single Post
 
Old 03-28-2013, 09:17 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,521
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Gay,

First off, I don't see any particular reason to involve a CSV file, as you can populate an Excel calendar directly from Excel. The following code shows how you might do that, though nothing in the workbook is referenced (you'd presumably want to reference your dropdowns - but you don't seem to have one for the date).
Code:
Sub Demo()
Dim objOutlook As Outlook.Application
Dim objApptItem As Outlook.AppointmentItem
Dim OlAttendee
Set objOutlook = New Outlook.Application
Set objApptItem = objOutlook.CreateItem(olAppointmentItem)
With objApptItem
  .AllDayEvent = False
  .MeetingStatus = olMeeting
  .Subject = "Strategy Meeting"
  .Location = "Conference Room B"
  .Start = #9/24/2002 1:30:00 PM#
  .Duration = 90
  Set OlAttendee = .Recipients.Add("Nate Sun")
  OlAttendee.Type = olRequired
  Set OlAttendee = .Recipients.Add("Kevin Kennedy")
  OlAttendee.Type = olOptional
  Set OlAttendee = .Recipients.Add("Conference Room B")
  OlAttendee.Type = olResource
  .Display
End With
End Sub
Aside from the Outlook automation, for which you'd need to set a reference to Outlook, the code is taken from the Outlook vba help file. I don't believe creating a CSV file would simplify things.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote