Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA - update Outlook calendar item

Status
Not open for further replies.

dvirgint

Programmer
Jun 28, 2010
85
CA
Hello,

I am able to create an Outlook appointment from Excel using code I got from : [URL unfurl="true"]http://www.mrexcel.com/forum/excel-questions/553718-excel-visual-basic-applications-update-create-delete-appointments.html[/url]

Code:
Option Explicit
 
Public Function CheckAppointment(ByVal argCheckDate As Date) As Boolean
 
  Dim oApp As Outlook.Application
  Dim oNameSpace As Outlook.Namespace
  Dim oApptItem As Outlook.AppointmentItem
  Dim oFolder As Outlook.MAPIFolder
  Dim oMeetingoApptItem As Outlook.MeetingItem
  Dim oObject As Object
  
  On Error Resume Next
  ' check if Outlook is running
  Set oApp = GetObject("Outlook.Application")
  If Err <> 0 Then
    'if not running, start it
    Set oApp = CreateObject("Outlook.Application")
  End If
  
  Set oNameSpace = oApp.GetNamespace("MAPI")
  Set oFolder = oNameSpace.GetDefaultFolder(olFolderCalendar)
  
  CheckAppointment = False
  For Each oObject In oFolder.Items
    If oObject.Class = olAppointment Then
      Set oApptItem = oObject
      If oApptItem.Start = argCheckDate Then
        CheckAppointment = True
      End If
    End If
  Next oObject
    
  Set oApp = Nothing
  Set oNameSpace = Nothing
  Set oApptItem = Nothing
  Set oFolder = Nothing
  Set oObject = Nothing
   
End Function

In most cases, I have to update a created appointment to add new information. Can anyone give me any suggestions in how to do this?

Any help would be greatly appreciated.

dvirgint
 
hi,

I really don't understand what question you are asking. Please be more specific.

You would get much better results if you would post VBA in forum707.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Thanks Skip for the information. Sorry to have posted to the wrong forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top