rventuradiaz
2010-04-22 12:53:10 UTC
I am trying to create and add UserProperty in a calendar's subfolder.
Code for creation works fine. However when I develop and debug code
for checking UserProperty, I found nothing was added. ¿Would you help
me to solve this issue, please?
I used the following code for set meeting: BEGIN
***************************************************************************
Dim olAppt As Outlook.AppointmentItem
Set olAppt = objSubCalFolder.Items.Add ' Mod 14-ABR-2010; Establece
el método Add en la Subcarpeta
Dim actField As UserProperty
Set actField = olAppt.UserProperties.Add("actId", olNumber) 'Set
UserProperty
' Set appointment start and end
olAppt.Start = FecIni + CDbl(HorIni)
olAppt.End = FecFin + CDbl(HorIni) / 24# + CDbl(Duracion) / 60# / 24#
Set myRecurrPatt = olAppt.GetRecurrencePattern
myRecurrPatt.RecurrenceType = olRecursDaily
myRecurrPatt.PatternStartDate = FecIni
myRecurrPatt.PatternEndDate = FecFin
' Configurar la información de otra cita...
With olAppt
.Duration = Duracion
.Subject = Asunto
.Body = "Reserva de Aula para actividad: " & Asunto
.Location = "Oficina doméstica"
.ReminderMinutesBeforeStart = 60
.ReminderSet = True
'Is set value for property actId
.UserProperties("actId") = actCode End With
' Guardar la cita...
olAppt.Save
****************************************************************************************************************************
END
Until here, I works fine... However, when I develop and test the code
to check the UserProperty value, then return nothing value, meaning
there is no UserProperties. Here is the code:
Code for check UserProperty: BEGIN
****************************************************************************************
Dim olAppt As Outlook.AppointmentItem
Dim olApptUserProp As UserProperties
Set olAppt = objSubCalFolder.Items.Add
olCode_en_Espacio = False
' I restrict domain for UserProperty with constraint actId =
(ACTIVIDADID)
Set olApptUserProp = olAppt.UserProperties.Find("actId = " &
CStr(ACTIVIDADID))
' From here onwards, then an error occurs due to olApptUserProp value
is equal to nothing
With olApptUserProp
If olApptUserProp.Count > 0 Then olCode_en_Espacio =
olCode_en_Espacio Or True
End With
******************************************************************************************************************************
END
Code for creation works fine. However when I develop and debug code
for checking UserProperty, I found nothing was added. ¿Would you help
me to solve this issue, please?
I used the following code for set meeting: BEGIN
***************************************************************************
Dim olAppt As Outlook.AppointmentItem
Set olAppt = objSubCalFolder.Items.Add ' Mod 14-ABR-2010; Establece
el método Add en la Subcarpeta
Dim actField As UserProperty
Set actField = olAppt.UserProperties.Add("actId", olNumber) 'Set
UserProperty
' Set appointment start and end
olAppt.Start = FecIni + CDbl(HorIni)
olAppt.End = FecFin + CDbl(HorIni) / 24# + CDbl(Duracion) / 60# / 24#
Set myRecurrPatt = olAppt.GetRecurrencePattern
myRecurrPatt.RecurrenceType = olRecursDaily
myRecurrPatt.PatternStartDate = FecIni
myRecurrPatt.PatternEndDate = FecFin
' Configurar la información de otra cita...
With olAppt
.Duration = Duracion
.Subject = Asunto
.Body = "Reserva de Aula para actividad: " & Asunto
.Location = "Oficina doméstica"
.ReminderMinutesBeforeStart = 60
.ReminderSet = True
'Is set value for property actId
.UserProperties("actId") = actCode End With
' Guardar la cita...
olAppt.Save
****************************************************************************************************************************
END
Until here, I works fine... However, when I develop and test the code
to check the UserProperty value, then return nothing value, meaning
there is no UserProperties. Here is the code:
Code for check UserProperty: BEGIN
****************************************************************************************
Dim olAppt As Outlook.AppointmentItem
Dim olApptUserProp As UserProperties
Set olAppt = objSubCalFolder.Items.Add
olCode_en_Espacio = False
' I restrict domain for UserProperty with constraint actId =
(ACTIVIDADID)
Set olApptUserProp = olAppt.UserProperties.Find("actId = " &
CStr(ACTIVIDADID))
' From here onwards, then an error occurs due to olApptUserProp value
is equal to nothing
With olApptUserProp
If olApptUserProp.Count > 0 Then olCode_en_Espacio =
olCode_en_Espacio Or True
End With
******************************************************************************************************************************
END