M
Moe
Hi, I am using the following codes to generate the appointment on a
shared calender. I am having the problem with .RecurrenceState. I want
it to recure daily from Start Date till End Date.
Can somebody help me out please.
THanks
Moe
Dim objApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim objFolder As Outlook.MAPIFolder
Dim objDummy As Outlook.MailItem
Dim objRecip As Outlook.Recipient
Dim objAppt As Outlook.AppointmentItem
Dim strMsg As String
Dim strName As String
On Error Resume Next
' ### name of person whose Calendar you want to use ###
strName = "TORO Assessments"
Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")
Set objDummy = objApp.CreateItem(olMailItem)
Set objRecip = objDummy.Recipients.Add(strName)
objRecip.Resolve
If objRecip.Resolved Then
On Error Resume Next
Set objFolder = _
objNS.GetSharedDefaultFolder(objRecip, _
olFolderCalendar)
If Not objFolder Is Nothing Then
Set objAppt = objFolder.Items.Add
If Not objAppt Is Nothing Then
With objAppt
Dim strSubject As String
If Nz(Me.cboTesterName) <> "" Then
strSubject = "(" & GetAbbrevs(Me.cboTesterName.Column(1)) & ")"
Else
strSubject = ""
End If
.Subject = strSubject & Me.SYS_NME
'Me.SYS_NME & vbNullString
.Start = Me.TEST_BEGIN_DATE
'CDate(Me.TEST_BEGIN_DATE)
.Body = Me.SYS_NOTES
.Recipients = "Faisal Askari"
.End = Me.TEST_END_DATE
'.Duration = Me.txtDuration
'CDate(Me.TEST_END_DATE)
.AllDayEvent = False
.Save
End With
End If
End If
Else
MsgBox "Could not find " & Chr(34) & strName & Chr(34), , _
"User not found"
End If
Set objApp = Nothing
Set objNS = Nothing
Set objFolder = Nothing
Set objDummy = Nothing
Set objRecip = Nothing
Set objAppt = Nothing
shared calender. I am having the problem with .RecurrenceState. I want
it to recure daily from Start Date till End Date.
Can somebody help me out please.
THanks
Moe
Dim objApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim objFolder As Outlook.MAPIFolder
Dim objDummy As Outlook.MailItem
Dim objRecip As Outlook.Recipient
Dim objAppt As Outlook.AppointmentItem
Dim strMsg As String
Dim strName As String
On Error Resume Next
' ### name of person whose Calendar you want to use ###
strName = "TORO Assessments"
Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")
Set objDummy = objApp.CreateItem(olMailItem)
Set objRecip = objDummy.Recipients.Add(strName)
objRecip.Resolve
If objRecip.Resolved Then
On Error Resume Next
Set objFolder = _
objNS.GetSharedDefaultFolder(objRecip, _
olFolderCalendar)
If Not objFolder Is Nothing Then
Set objAppt = objFolder.Items.Add
If Not objAppt Is Nothing Then
With objAppt
Dim strSubject As String
If Nz(Me.cboTesterName) <> "" Then
strSubject = "(" & GetAbbrevs(Me.cboTesterName.Column(1)) & ")"
Else
strSubject = ""
End If
.Subject = strSubject & Me.SYS_NME
'Me.SYS_NME & vbNullString
.Start = Me.TEST_BEGIN_DATE
'CDate(Me.TEST_BEGIN_DATE)
.Body = Me.SYS_NOTES
.Recipients = "Faisal Askari"
.End = Me.TEST_END_DATE
'.Duration = Me.txtDuration
'CDate(Me.TEST_END_DATE)
.AllDayEvent = False
.Save
End With
End If
End If
Else
MsgBox "Could not find " & Chr(34) & strName & Chr(34), , _
"User not found"
End If
Set objApp = Nothing
Set objNS = Nothing
Set objFolder = Nothing
Set objDummy = Nothing
Set objRecip = Nothing
Set objAppt = Nothing