Error when creating 247 appointments in exchange mailbox

P

Peter Marchert

How to do that? This code occurs the same error:

Sub AddAppointment(ByVal objContact As Outlook.ContactItem)

Dim objAppointments As Outlook.Items
Dim objApp As Outlook.AppointmentItem
Dim colLinks As Outlook.Links
Dim objLink As Outlook.Link
Dim objSafeApp As Object

Set objAppointments =
Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
Set objSafeApp = CreateObject("SafeOutlook.SecureAppointment")
Set objApp = objAppointments.Add
objApp.Save
objSafeApp.Item = objApp
Set colLinks = objSafeApp.Links
With objSafeApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
Set objContact = Nothing
Set objSafeApp.Item = Nothing
Set objSafeApp = Nothing

End Sub

Peter
 
D

Dmitry Streblechenko

I meant the RDO family of objects, which does not rely on OOM at all.
You will need to change the variable declarations appropriately and use
something like

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Outlook.Session.MAPIOBJECT 'make them both use the
same session
set objContacts = Session.GetDefaultFolder(olFolderContacts).Items
set objAppointments =Session.GetDefaultFolder(olFolderCalendar).Items
....

Next version of Redemption will keep track of the open MAPI objects and
automatically release them when the number gets too high (they are
transparently reopened on demand), so you won't have to go through the
trouble of setting all objects to Nothing.
Send me an e-mail if you want a beta.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Peter Marchert said:
How to do that? This code occurs the same error:

Sub AddAppointment(ByVal objContact As Outlook.ContactItem)

Dim objAppointments As Outlook.Items
Dim objApp As Outlook.AppointmentItem
Dim colLinks As Outlook.Links
Dim objLink As Outlook.Link
Dim objSafeApp As Object

Set objAppointments =
Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
Set objSafeApp = CreateObject("SafeOutlook.SecureAppointment")
Set objApp = objAppointments.Add
objApp.Save
objSafeApp.Item = objApp
Set colLinks = objSafeApp.Links
With objSafeApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
Set objContact = Nothing
Set objSafeApp.Item = Nothing
Set objSafeApp = Nothing

End Sub

Peter

I can only suggest to use Redemption, which does not leave hanging
references...

Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool




Thanks for your idea, Ken.
I`m sorry, but there is no change.

On 6 Nov., 21:47, "Ken Slovak - [MVP - Outlook]" <[email protected]>
wrote:
Peter, see if this is any better:
Public objContacts As Outlook.Items
Public objContact As Outlook.ContactItem
Public objAppointments As Outlook.Items
Public objApp As Outlook.AppointmentItem
Public colLinks As Outlook.Links
Public objLink As Outlook.Link
Sub Test()
Dim oNS As Outlook.NameSpace
Set oNS = Outlook.GetNameSpace("MAPI")
Set objContacts = _
oNS.GetDefaultFolder(olFolderContacts).Items
Set objAppointments = _
oNS.GetDefaultFolder(olFolderCalendar).Items
Call CreateAppointments(1, 230)
Call CreateAppointments(231, 400)
Set objContacts = Nothing
Set objContact = Nothing
Set objAppointments = Nothing
Set objApp = Nothing
Set colLinks = Nothing
Set objLink = Nothing
End Sub
Sub CreateAppointments(ByVal lngFrom As Long, ByVal lngTo As Long)
Dim lngIndex As Long
For lngIndex = lngFrom To lngTo
Set objContact = objContacts.Item(lngIndex)
Call AddAppointment(objContact)
Set objContact = Nothing
Next
End Sub
Sub AddAppointment(ByVal objContact As Outlook.ContactItem)
Set objApp = objAppointments.Add
Set colLinks = objApp.Links
With objApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
End Sub
Thank you Dmitry, but the error is still there:
Sub Test()
Call CreateAppointments(1, 230)
Call CreateAppointments(231, 400)
End Sub
Sub CreateAppointments(ByVal lngFrom As Long, ByVal lngTo As Long)
Dim objContacts As Outlook.Items
Dim objContact As Outlook.ContactItem
Dim lngIndex As Long
Set objContacts =
Outlook.Session.GetDefaultFolder(olFolderContacts).Items
For lngIndex = lngFrom To lngTo
Set objContact = objContacts(lngIndex)
Call AddAppointment(objContact)
Set objContact = Nothing
Next
Sub AddAppointment(ByVal objContact As Outlook.ContactItem)
Dim objAppointments As Outlook.Items
Dim objApp As Outlook.AppointmentItem
Dim colLinks As Outlook.Links
Dim objLink As Outlook.Link
Set objAppointments =
Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
Set objApp = objAppointments.Add
Set colLinks = objApp.Links
With objApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
Set objContact = Nothing
Peter- Zitierten Text ausblenden -
- Zitierten Text anzeigen -- Zitierten Text ausblenden -

- Zitierten Text anzeigen -
 
P

Peter Marchert

Thank you Dmitry, this works fine.

But I have another problem. In the code I create recurrence
appointments:

Set objRecPattern = .GetRecurrencePattern
objRecPattern.RecurrenceType = olRecursYearly
objRecPattern.PatternStartDate = dtmBirthday
objRecPattern.NoEndDate = True

With the OOM the description of the appointment is (translated) "This
appointment occurs every year on the 25th October, starting on 25th
October 2007" and no reminder comes up.

Same code with RDO (objRecPattern then is dimed as object not longer
as Outlook.RecurrencePattern) set the description to "This appointment
occurs every year on the 25th October, in the period from 25.10.2007
to 02.01.4501." and a reminder comes up. So may be I have to set one
more parameter in RDO?

Peter

I meant the RDO family of objects, which does not rely on OOM at all.
You will need to change the variable declarations appropriately and use
something like

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Outlook.Session.MAPIOBJECT 'make them both use the
same session
set objContacts = Session.GetDefaultFolder(olFolderContacts).Items
set objAppointments =Session.GetDefaultFolder(olFolderCalendar).Items
...

Next version of Redemption will keep track of the open MAPI objects and
automatically release them when the number gets too high (they are
transparently reopened on demand), so you won't have to go through the
trouble of setting all objects to Nothing.
Send me an e-mail if you want a beta.

Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool




How to do that? This code occurs the same error:
Sub AddAppointment(ByVal objContact As Outlook.ContactItem)
Dim objAppointments As Outlook.Items
Dim objApp As Outlook.AppointmentItem
Dim colLinks As Outlook.Links
Dim objLink As Outlook.Link
Dim objSafeApp As Object
Set objAppointments =
Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
Set objSafeApp = CreateObject("SafeOutlook.SecureAppointment")
Set objApp = objAppointments.Add
objApp.Save
objSafeApp.Item = objApp
Set colLinks = objSafeApp.Links
With objSafeApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
Set objContact = Nothing
Set objSafeApp.Item = Nothing
Set objSafeApp = Nothing
End Sub

I can only suggest to use Redemption, which does not leave hanging
references...
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Thanks for your idea, Ken.
I`m sorry, but there is no change.
Peter
On 6 Nov., 21:47, "Ken Slovak - [MVP - Outlook]" <[email protected]>
wrote:
Peter, see if this is any better:
Public objContacts As Outlook.Items
Public objContact As Outlook.ContactItem
Public objAppointments As Outlook.Items
Public objApp As Outlook.AppointmentItem
Public colLinks As Outlook.Links
Public objLink As Outlook.Link
Sub Test()
Dim oNS As Outlook.NameSpace
Set oNS = Outlook.GetNameSpace("MAPI")
Set objContacts = _
oNS.GetDefaultFolder(olFolderContacts).Items
Set objAppointments = _
oNS.GetDefaultFolder(olFolderCalendar).Items
Call CreateAppointments(1, 230)
Call CreateAppointments(231, 400)
Set objContacts = Nothing
Set objContact = Nothing
Set objAppointments = Nothing
Set objApp = Nothing
Set colLinks = Nothing
Set objLink = Nothing
End Sub
Sub CreateAppointments(ByVal lngFrom As Long, ByVal lngTo As Long)
Dim lngIndex As Long
For lngIndex = lngFrom To lngTo
Set objContact = objContacts.Item(lngIndex)
Call AddAppointment(objContact)
Set objContact = Nothing
Next
End Sub
Sub AddAppointment(ByVal objContact As Outlook.ContactItem)
Set objApp = objAppointments.Add
Set colLinks = objApp.Links
With objApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
End Sub


Thank you Dmitry, but the error is still there:
Sub Test()
Call CreateAppointments(1, 230)
Call CreateAppointments(231, 400)
End Sub
Sub CreateAppointments(ByVal lngFrom As Long, ByVal lngTo As Long)
Dim objContacts As Outlook.Items
Dim objContact As Outlook.ContactItem
Dim lngIndex As Long
Set objContacts =
Outlook.Session.GetDefaultFolder(olFolderContacts).Items
For lngIndex = lngFrom To lngTo
Set objContact = objContacts(lngIndex)
Call AddAppointment(objContact)
Set objContact = Nothing
Next
End Sub
Sub AddAppointment(ByVal objContact As Outlook.ContactItem)
Dim objAppointments As Outlook.Items
Dim objApp As Outlook.AppointmentItem
Dim colLinks As Outlook.Links
Dim objLink As Outlook.Link
Set objAppointments =
Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
Set objApp = objAppointments.Add
Set colLinks = objApp.Links
With objApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
Set objContact = Nothing
End Sub
Peter- Zitierten Text ausblenden -
- Zitierten Text anzeigen -- Zitierten Text ausblenden -
- Zitierten Text anzeigen -- Zitierten Text ausblenden -

- Zitierten Text anzeigen -
 
D

Dmitry Streblechenko

Try to set RDOAppointmentItem.ReminderSet to false

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Peter Marchert said:
Thank you Dmitry, this works fine.

But I have another problem. In the code I create recurrence
appointments:

Set objRecPattern = .GetRecurrencePattern
objRecPattern.RecurrenceType = olRecursYearly
objRecPattern.PatternStartDate = dtmBirthday
objRecPattern.NoEndDate = True

With the OOM the description of the appointment is (translated) "This
appointment occurs every year on the 25th October, starting on 25th
October 2007" and no reminder comes up.

Same code with RDO (objRecPattern then is dimed as object not longer
as Outlook.RecurrencePattern) set the description to "This appointment
occurs every year on the 25th October, in the period from 25.10.2007
to 02.01.4501." and a reminder comes up. So may be I have to set one
more parameter in RDO?

Peter

I meant the RDO family of objects, which does not rely on OOM at all.
You will need to change the variable declarations appropriately and use
something like

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Outlook.Session.MAPIOBJECT 'make them both use the
same session
set objContacts = Session.GetDefaultFolder(olFolderContacts).Items
set objAppointments =Session.GetDefaultFolder(olFolderCalendar).Items
...

Next version of Redemption will keep track of the open MAPI objects and
automatically release them when the number gets too high (they are
transparently reopened on demand), so you won't have to go through the
trouble of setting all objects to Nothing.
Send me an e-mail if you want a beta.

Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool




How to do that? This code occurs the same error:
Sub AddAppointment(ByVal objContact As Outlook.ContactItem)
Dim objAppointments As Outlook.Items
Dim objApp As Outlook.AppointmentItem
Dim colLinks As Outlook.Links
Dim objLink As Outlook.Link
Dim objSafeApp As Object
Set objAppointments =
Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
Set objSafeApp = CreateObject("SafeOutlook.SecureAppointment")
Set objApp = objAppointments.Add
objApp.Save
objSafeApp.Item = objApp
Set colLinks = objSafeApp.Links
With objSafeApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
Set objContact = Nothing
Set objSafeApp.Item = Nothing
Set objSafeApp = Nothing
End Sub

I can only suggest to use Redemption, which does not leave hanging
references...
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
Thanks for your idea, Ken.
I`m sorry, but there is no change.

On 6 Nov., 21:47, "Ken Slovak - [MVP - Outlook]"
<[email protected]>
wrote:
Peter, see if this is any better:
Public objContacts As Outlook.Items
Public objContact As Outlook.ContactItem
Public objAppointments As Outlook.Items
Public objApp As Outlook.AppointmentItem
Public colLinks As Outlook.Links
Public objLink As Outlook.Link
Sub Test()
Dim oNS As Outlook.NameSpace
Set oNS = Outlook.GetNameSpace("MAPI")
Set objContacts = _
oNS.GetDefaultFolder(olFolderContacts).Items
Set objAppointments = _
oNS.GetDefaultFolder(olFolderCalendar).Items
Call CreateAppointments(1, 230)
Call CreateAppointments(231, 400)
Set objContacts = Nothing
Set objContact = Nothing
Set objAppointments = Nothing
Set objApp = Nothing
Set colLinks = Nothing
Set objLink = Nothing
End Sub
Sub CreateAppointments(ByVal lngFrom As Long, ByVal lngTo As Long)
Dim lngIndex As Long
For lngIndex = lngFrom To lngTo
Set objContact = objContacts.Item(lngIndex)
Call AddAppointment(objContact)
Set objContact = Nothing
Next
End Sub
Sub AddAppointment(ByVal objContact As Outlook.ContactItem)
Set objApp = objAppointments.Add
Set colLinks = objApp.Links
With objApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
End Sub
Thank you Dmitry, but the error is still there:
Sub Test()
Call CreateAppointments(1, 230)
Call CreateAppointments(231, 400)
End Sub
Sub CreateAppointments(ByVal lngFrom As Long, ByVal lngTo As
Long)
Dim objContacts As Outlook.Items
Dim objContact As Outlook.ContactItem
Dim lngIndex As Long
Set objContacts =
Outlook.Session.GetDefaultFolder(olFolderContacts).Items
For lngIndex = lngFrom To lngTo
Set objContact = objContacts(lngIndex)
Call AddAppointment(objContact)
Set objContact = Nothing
Next
Sub AddAppointment(ByVal objContact As Outlook.ContactItem)
Dim objAppointments As Outlook.Items
Dim objApp As Outlook.AppointmentItem
Dim colLinks As Outlook.Links
Dim objLink As Outlook.Link
Set objAppointments =
Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
Set objApp = objAppointments.Add
Set colLinks = objApp.Links
With objApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
Set objContact = Nothing
Peter- Zitierten Text ausblenden -
- Zitierten Text anzeigen -- Zitierten Text ausblenden -
- Zitierten Text anzeigen -- Zitierten Text ausblenden -

- Zitierten Text anzeigen -
 
P

Peter Marchert

The reminder should not be deactivated, but not appear when creating
the items. With the code for OOM this is ok, with the same code in RDO
the description of the appointments is different and the reminder for
all created items appears. I think there is the problem. Why could
this be if the code is the same?

Peter

Try to set RDOAppointmentItem.ReminderSet to false

Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool




Thank you Dmitry, this works fine.
But I have another problem. In the code I create recurrence
appointments:
Set objRecPattern = .GetRecurrencePattern
objRecPattern.RecurrenceType = olRecursYearly
objRecPattern.PatternStartDate = dtmBirthday
objRecPattern.NoEndDate = True
With the OOM the description of the appointment is (translated) "This
appointment occurs every year on the 25th October, starting on 25th
October 2007" and no reminder comes up.
Same code with RDO (objRecPattern then is dimed as object not longer
as Outlook.RecurrencePattern) set the description to "This appointment
occurs every year on the 25th October, in the period from 25.10.2007
to 02.01.4501." and a reminder comes up. So may be I have to set one
more parameter in RDO?

I meant the RDO family of objects, which does not rely on OOM at all.
You will need to change the variable declarations appropriately and use
something like
set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Outlook.Session.MAPIOBJECT 'make them both use the
same session
set objContacts = Session.GetDefaultFolder(olFolderContacts).Items
set objAppointments =Session.GetDefaultFolder(olFolderCalendar).Items
...
Next version of Redemption will keep track of the open MAPI objects and
automatically release them when the number gets too high (they are
transparently reopened on demand), so you won't have to go through the
trouble of setting all objects to Nothing.
Send me an e-mail if you want a beta.
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

How to do that? This code occurs the same error:
Sub AddAppointment(ByVal objContact As Outlook.ContactItem)
Dim objAppointments As Outlook.Items
Dim objApp As Outlook.AppointmentItem
Dim colLinks As Outlook.Links
Dim objLink As Outlook.Link
Dim objSafeApp As Object
Set objAppointments =
Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
Set objSafeApp = CreateObject("SafeOutlook.SecureAppointment")
Set objApp = objAppointments.Add
objApp.Save
objSafeApp.Item = objApp
Set colLinks = objSafeApp.Links
With objSafeApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
Set objContact = Nothing
Set objSafeApp.Item = Nothing
Set objSafeApp = Nothing
End Sub
Peter
I can only suggest to use Redemption, which does not leave hanging
references...
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Thanks for your idea, Ken.
I`m sorry, but there is no change.
Peter
On 6 Nov., 21:47, "Ken Slovak - [MVP - Outlook]"
<[email protected]>
wrote:
Peter, see if this is any better:
Public objContacts As Outlook.Items
Public objContact As Outlook.ContactItem
Public objAppointments As Outlook.Items
Public objApp As Outlook.AppointmentItem
Public colLinks As Outlook.Links
Public objLink As Outlook.Link
Sub Test()
Dim oNS As Outlook.NameSpace
Set oNS = Outlook.GetNameSpace("MAPI")
Set objContacts = _
oNS.GetDefaultFolder(olFolderContacts).Items
Set objAppointments = _
oNS.GetDefaultFolder(olFolderCalendar).Items
Call CreateAppointments(1, 230)
Call CreateAppointments(231, 400)
Set objContacts = Nothing
Set objContact = Nothing
Set objAppointments = Nothing
Set objApp = Nothing
Set colLinks = Nothing
Set objLink = Nothing
End Sub
Sub CreateAppointments(ByVal lngFrom As Long, ByVal lngTo As Long)
Dim lngIndex As Long
For lngIndex = lngFrom To lngTo
Set objContact = objContacts.Item(lngIndex)
Call AddAppointment(objContact)
Set objContact = Nothing
Next
End Sub
Sub AddAppointment(ByVal objContact As Outlook.ContactItem)
Set objApp = objAppointments.Add
Set colLinks = objApp.Links
With objApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
End Sub


Thank you Dmitry, but the error is still there:
Sub Test()
Call CreateAppointments(1, 230)
Call CreateAppointments(231, 400)
End Sub
Sub CreateAppointments(ByVal lngFrom As Long, ByVal lngTo As
Long)
Dim objContacts As Outlook.Items
Dim objContact As Outlook.ContactItem
Dim lngIndex As Long
Set objContacts =
Outlook.Session.GetDefaultFolder(olFolderContacts).Items
For lngIndex = lngFrom To lngTo
Set objContact = objContacts(lngIndex)
Call AddAppointment(objContact)
Set objContact = Nothing
Next
End Sub
Sub AddAppointment(ByVal objContact As Outlook.ContactItem)
Dim objAppointments As Outlook.Items
Dim objApp As Outlook.AppointmentItem
Dim colLinks As Outlook.Links
Dim objLink As Outlook.Link
Set objAppointments =
Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
Set objApp = objAppointments.Add
Set colLinks = objApp.Links
With objApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
Set objContact = Nothing
End Sub
Peter- Zitierten Text ausblenden -
- Zitierten Text anzeigen -- Zitierten Text ausblenden -
- Zitierten Text anzeigen -- Zitierten Text ausblenden -
- Zitierten Text anzeigen -- Zitierten Text ausblenden -

- Zitierten Text anzeigen -
 
D

Dmitry Streblechenko

I am not sure what you mean by "but not appear when creating the items".
Do you mean it shoudl nto appear while your codei is still running in a loop
creating items? Why shouldn't Outlook display a reminder?
I would imagine if you are using OOM, it physically cannot do so since it is
busy with your script, but RDO does not use Outlook, so it is free to
display a reminder.
As for the recurrence description, what version of Redemption are you using?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Peter Marchert said:
The reminder should not be deactivated, but not appear when creating
the items. With the code for OOM this is ok, with the same code in RDO
the description of the appointments is different and the reminder for
all created items appears. I think there is the problem. Why could
this be if the code is the same?

Peter

Try to set RDOAppointmentItem.ReminderSet to false

Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool




Thank you Dmitry, this works fine.
But I have another problem. In the code I create recurrence
appointments:
Set objRecPattern = .GetRecurrencePattern
objRecPattern.RecurrenceType = olRecursYearly
objRecPattern.PatternStartDate = dtmBirthday
objRecPattern.NoEndDate = True
With the OOM the description of the appointment is (translated) "This
appointment occurs every year on the 25th October, starting on 25th
October 2007" and no reminder comes up.
Same code with RDO (objRecPattern then is dimed as object not longer
as Outlook.RecurrencePattern) set the description to "This appointment
occurs every year on the 25th October, in the period from 25.10.2007
to 02.01.4501." and a reminder comes up. So may be I have to set one
more parameter in RDO?

I meant the RDO family of objects, which does not rely on OOM at all.
You will need to change the variable declarations appropriately and
use
something like
set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Outlook.Session.MAPIOBJECT 'make them both use
the
same session
set objContacts = Session.GetDefaultFolder(olFolderContacts).Items
set objAppointments =Session.GetDefaultFolder(olFolderCalendar).Items
...
Next version of Redemption will keep track of the open MAPI objects
and
automatically release them when the number gets too high (they are
transparently reopened on demand), so you won't have to go through the
trouble of setting all objects to Nothing.
Send me an e-mail if you want a beta.
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
How to do that? This code occurs the same error:
Sub AddAppointment(ByVal objContact As Outlook.ContactItem)
Dim objAppointments As Outlook.Items
Dim objApp As Outlook.AppointmentItem
Dim colLinks As Outlook.Links
Dim objLink As Outlook.Link
Dim objSafeApp As Object
Set objAppointments =
Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
Set objSafeApp = CreateObject("SafeOutlook.SecureAppointment")
Set objApp = objAppointments.Add
objApp.Save
objSafeApp.Item = objApp
Set colLinks = objSafeApp.Links
With objSafeApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
Set objContact = Nothing
Set objSafeApp.Item = Nothing
Set objSafeApp = Nothing
End Sub

I can only suggest to use Redemption, which does not leave hanging
references...
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
Thanks for your idea, Ken.
I`m sorry, but there is no change.

On 6 Nov., 21:47, "Ken Slovak - [MVP - Outlook]"
<[email protected]>
wrote:
Peter, see if this is any better:
Public objContacts As Outlook.Items
Public objContact As Outlook.ContactItem
Public objAppointments As Outlook.Items
Public objApp As Outlook.AppointmentItem
Public colLinks As Outlook.Links
Public objLink As Outlook.Link
Sub Test()
Dim oNS As Outlook.NameSpace
Set oNS = Outlook.GetNameSpace("MAPI")
Set objContacts = _
oNS.GetDefaultFolder(olFolderContacts).Items
Set objAppointments = _
oNS.GetDefaultFolder(olFolderCalendar).Items
Call CreateAppointments(1, 230)
Call CreateAppointments(231, 400)
Set objContacts = Nothing
Set objContact = Nothing
Set objAppointments = Nothing
Set objApp = Nothing
Set colLinks = Nothing
Set objLink = Nothing
End Sub
Sub CreateAppointments(ByVal lngFrom As Long, ByVal lngTo As
Long)
Dim lngIndex As Long
For lngIndex = lngFrom To lngTo
Set objContact = objContacts.Item(lngIndex)
Call AddAppointment(objContact)
Set objContact = Nothing
Next
End Sub
Sub AddAppointment(ByVal objContact As Outlook.ContactItem)
Set objApp = objAppointments.Add
Set colLinks = objApp.Links
With objApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
End Sub
Thank you Dmitry, but the error is still there:
Sub Test()
Call CreateAppointments(1, 230)
Call CreateAppointments(231, 400)
End Sub
Sub CreateAppointments(ByVal lngFrom As Long, ByVal lngTo As
Long)
Dim objContacts As Outlook.Items
Dim objContact As Outlook.ContactItem
Dim lngIndex As Long
Set objContacts =
Outlook.Session.GetDefaultFolder(olFolderContacts).Items
For lngIndex = lngFrom To lngTo
Set objContact = objContacts(lngIndex)
Call AddAppointment(objContact)
Set objContact = Nothing
Next
Sub AddAppointment(ByVal objContact As Outlook.ContactItem)
Dim objAppointments As Outlook.Items
Dim objApp As Outlook.AppointmentItem
Dim colLinks As Outlook.Links
Dim objLink As Outlook.Link
Set objAppointments =
Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
Set objApp = objAppointments.Add
Set colLinks = objApp.Links
With objApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
Set objContact = Nothing
Peter- Zitierten Text ausblenden -
- Zitierten Text anzeigen -- Zitierten Text ausblenden -
- Zitierten Text anzeigen -- Zitierten Text ausblenden -
- Zitierten Text anzeigen -- Zitierten Text ausblenden -

- Zitierten Text anzeigen -
 
P

Peter Marchert

You can see what I mean, if you use the following code:

Sub CreateAppointments()

Dim objSession As Object
Dim objAppointments As Object
Dim objAppointment As Object

Set objSession = CreateObject("Redemption.RDOSession")
objSession.MAPIOBJECT = Outlook.Session.MAPIOBJECT

Set objAppointment =
objSession.GetDefaultFolder(olFolderCalendar).Items.Add

With objAppointment
.ReminderSet = True
.Subject = "Test"
.AllDayEvent = True
.Start = Date - 5
Set objRecPattern = .GetRecurrencePattern
objRecPattern.RecurrenceType = olRecursYearly
objRecPattern.PatternStartDate = Date - 5
objRecPattern.NoEndDate = True
.Save
End With

End Sub

A reminder comes up from midnight of the last day.

Redemption version is 4.5.0.730.

Peter

I am not sure what you mean by "but not appear when creating the items".
Do you mean it shoudl nto appear while your codei is still running in a loop
creating items? Why shouldn't Outlook display a reminder?
I would imagine if you are using OOM, it physically cannot do so since it is
busy with your script, but RDO does not use Outlook, so it is free to
display a reminder.
As for the recurrence description, what version of Redemption are you using?

Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool




The reminder should not be deactivated, but not appear when creating
the items. With the code for OOM this is ok, with the same code in RDO
the description of the appointments is different and the reminder for
all created items appears. I think there is the problem. Why could
this be if the code is the same?

Try to set RDOAppointmentItem.ReminderSet to false
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Thank you Dmitry, this works fine.
But I have another problem. In the code I create recurrence
appointments:
Set objRecPattern = .GetRecurrencePattern
objRecPattern.RecurrenceType = olRecursYearly
objRecPattern.PatternStartDate = dtmBirthday
objRecPattern.NoEndDate = True
With the OOM the description of the appointment is (translated) "This
appointment occurs every year on the 25th October, starting on 25th
October 2007" and no reminder comes up.
Same code with RDO (objRecPattern then is dimed as object not longer
as Outlook.RecurrencePattern) set the description to "This appointment
occurs every year on the 25th October, in the period from 25.10.2007
to 02.01.4501." and a reminder comes up. So may be I have to set one
more parameter in RDO?
Peter
I meant the RDO family of objects, which does not rely on OOM at all.
You will need to change the variable declarations appropriately and
use
something like
set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Outlook.Session.MAPIOBJECT 'make them both use
the
same session
set objContacts = Session.GetDefaultFolder(olFolderContacts).Items
set objAppointments =Session.GetDefaultFolder(olFolderCalendar).Items
...
Next version of Redemption will keep track of the open MAPI objects
and
automatically release them when the number gets too high (they are
transparently reopened on demand), so you won't have to go through the
trouble of setting all objects to Nothing.
Send me an e-mail if you want a beta.
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

How to do that? This code occurs the same error:
Sub AddAppointment(ByVal objContact As Outlook.ContactItem)
Dim objAppointments As Outlook.Items
Dim objApp As Outlook.AppointmentItem
Dim colLinks As Outlook.Links
Dim objLink As Outlook.Link
Dim objSafeApp As Object
Set objAppointments =
Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
Set objSafeApp = CreateObject("SafeOutlook.SecureAppointment")
Set objApp = objAppointments.Add
objApp.Save
objSafeApp.Item = objApp
Set colLinks = objSafeApp.Links
With objSafeApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
Set objContact = Nothing
Set objSafeApp.Item = Nothing
Set objSafeApp = Nothing
End Sub
Peter
I can only suggest to use Redemption, which does not leave hanging
references...
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Thanks for your idea, Ken.
I`m sorry, but there is no change.
Peter
On 6 Nov., 21:47, "Ken Slovak - [MVP - Outlook]"
<[email protected]>
wrote:
Peter, see if this is any better:
Public objContacts As Outlook.Items
Public objContact As Outlook.ContactItem
Public objAppointments As Outlook.Items
Public objApp As Outlook.AppointmentItem
Public colLinks As Outlook.Links
Public objLink As Outlook.Link
Sub Test()
Dim oNS As Outlook.NameSpace
Set oNS = Outlook.GetNameSpace("MAPI")
Set objContacts = _
oNS.GetDefaultFolder(olFolderContacts).Items
Set objAppointments = _
oNS.GetDefaultFolder(olFolderCalendar).Items
Call CreateAppointments(1, 230)
Call CreateAppointments(231, 400)
Set objContacts = Nothing
Set objContact = Nothing
Set objAppointments = Nothing
Set objApp = Nothing
Set colLinks = Nothing
Set objLink = Nothing
End Sub
Sub CreateAppointments(ByVal lngFrom As Long, ByVal lngTo As
Long)
Dim lngIndex As Long
For lngIndex = lngFrom To lngTo
Set objContact = objContacts.Item(lngIndex)
Call AddAppointment(objContact)
Set objContact = Nothing
Next
End Sub
Sub AddAppointment(ByVal objContact As Outlook.ContactItem)
Set objApp = objAppointments.Add
Set colLinks = objApp.Links
With objApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
End Sub


Thank you Dmitry, but the error is still there:
Sub Test()
Call CreateAppointments(1, 230)
Call CreateAppointments(231, 400)
End Sub
Sub CreateAppointments(ByVal lngFrom As Long, ByVal lngTo As
Long)
Dim objContacts As Outlook.Items
Dim objContact As Outlook.ContactItem
Dim lngIndex As Long
Set objContacts =
Outlook.Session.GetDefaultFolder(olFolderContacts).Items
For lngIndex = lngFrom To lngTo
Set objContact = objContacts(lngIndex)
Call AddAppointment(objContact)
Set objContact = Nothing
Next
End Sub
Sub AddAppointment(ByVal objContact As Outlook.ContactItem)
Dim objAppointments As Outlook.Items
Dim objApp As Outlook.AppointmentItem
Dim colLinks As Outlook.Links
Dim objLink As Outlook.Link
Set objAppointments =
Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
Set objApp = objAppointments.Add
Set colLinks = objApp.Links
With objApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
Set objContact = Nothing
End Sub
Peter- Zitierten Text ausblenden -
- Zitierten Text anzeigen -- Zitierten Text ausblenden -
- Zitierten Text anzeigen -- Zitierten Text ausblenden -
- Zitierten Text anzeigen -- Zitierten Text ausblenden -
- Zitierten Text anzeigen -- Zitierten Text ausblenden -

- Zitierten Text anzeigen -
 
P

Peter Marchert

Here are both methods to compare:

Sub CreateAppointmentsRDO()

Dim objSession As Object
Dim objAppointment As Object
Dim objRecPattern As Object
Set objSession = CreateObject("Redemption.RDOSession")
objSession.MAPIOBJECT = Outlook.Session.MAPIOBJECT

Set objAppointment =
objSession.GetDefaultFolder(olFolderCalendar).Items.Add

With objAppointment
.ReminderSet = True
.Subject = "Test by RDO"
.AllDayEvent = True
.Start = Date - 5
Set objRecPattern = .GetRecurrencePattern
objRecPattern.RecurrenceType = olRecursYearly
objRecPattern.PatternStartDate = Date - 5
objRecPattern.NoEndDate = True
.Save
End With

Set objRecPattern = Nothing
Set objAppointment = Nothing
Set objSession = Nothing

End Sub

Sub CreateAppointmentsOOM()

Dim objAppointment As Outlook.AppointmentItem
Dim objRecPattern As Outlook.RecurrencePattern

Set objAppointment =
Outlook.Session.GetDefaultFolder(olFolderCalendar).Items.Add

With objAppointment
.ReminderSet = True
.Subject = "Test by OOM"
.AllDayEvent = True
.Start = Date - 5
Set objRecPattern = .GetRecurrencePattern
objRecPattern.RecurrenceType = olRecursYearly
objRecPattern.PatternStartDate = Date - 5
objRecPattern.NoEndDate = True
.Save
End With

Set objRecPattern = Nothing
Set objAppointment = Nothing

End Sub

Peter
 
D

Dmitry Streblechenko

AllDayEvent means it starts at midnight, so by default (unless you set it
otherwise) the reminder time will be set to 15 minutes before the start.
You can explicitly set the ReminderTime property if you want full control
over the reminder.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Peter Marchert said:
You can see what I mean, if you use the following code:

Sub CreateAppointments()

Dim objSession As Object
Dim objAppointments As Object
Dim objAppointment As Object

Set objSession = CreateObject("Redemption.RDOSession")
objSession.MAPIOBJECT = Outlook.Session.MAPIOBJECT

Set objAppointment =
objSession.GetDefaultFolder(olFolderCalendar).Items.Add

With objAppointment
.ReminderSet = True
.Subject = "Test"
.AllDayEvent = True
.Start = Date - 5
Set objRecPattern = .GetRecurrencePattern
objRecPattern.RecurrenceType = olRecursYearly
objRecPattern.PatternStartDate = Date - 5
objRecPattern.NoEndDate = True
.Save
End With

End Sub

A reminder comes up from midnight of the last day.

Redemption version is 4.5.0.730.

Peter

I am not sure what you mean by "but not appear when creating the items".
Do you mean it shoudl nto appear while your codei is still running in a
loop
creating items? Why shouldn't Outlook display a reminder?
I would imagine if you are using OOM, it physically cannot do so since it
is
busy with your script, but RDO does not use Outlook, so it is free to
display a reminder.
As for the recurrence description, what version of Redemption are you
using?

Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool




The reminder should not be deactivated, but not appear when creating
the items. With the code for OOM this is ok, with the same code in RDO
the description of the appointments is different and the reminder for
all created items appears. I think there is the problem. Why could
this be if the code is the same?

Try to set RDOAppointmentItem.ReminderSet to false
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
Thank you Dmitry, this works fine.
But I have another problem. In the code I create recurrence
appointments:
Set objRecPattern = .GetRecurrencePattern
objRecPattern.RecurrenceType = olRecursYearly
objRecPattern.PatternStartDate = dtmBirthday
objRecPattern.NoEndDate = True
With the OOM the description of the appointment is (translated)
"This
appointment occurs every year on the 25th October, starting on 25th
October 2007" and no reminder comes up.
Same code with RDO (objRecPattern then is dimed as object not longer
as Outlook.RecurrencePattern) set the description to "This
appointment
occurs every year on the 25th October, in the period from 25.10.2007
to 02.01.4501." and a reminder comes up. So may be I have to set one
more parameter in RDO?

I meant the RDO family of objects, which does not rely on OOM at
all.
You will need to change the variable declarations appropriately and
use
something like
set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Outlook.Session.MAPIOBJECT 'make them both
use
the
same session
set objContacts = Session.GetDefaultFolder(olFolderContacts).Items
set objAppointments
=Session.GetDefaultFolder(olFolderCalendar).Items
...
Next version of Redemption will keep track of the open MAPI objects
and
automatically release them when the number gets too high (they are
transparently reopened on demand), so you won't have to go through
the
trouble of setting all objects to Nothing.
Send me an e-mail if you want a beta.
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
How to do that? This code occurs the same error:
Sub AddAppointment(ByVal objContact As Outlook.ContactItem)
Dim objAppointments As Outlook.Items
Dim objApp As Outlook.AppointmentItem
Dim colLinks As Outlook.Links
Dim objLink As Outlook.Link
Dim objSafeApp As Object
Set objAppointments =
Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
Set objSafeApp = CreateObject("SafeOutlook.SecureAppointment")
Set objApp = objAppointments.Add
objApp.Save
objSafeApp.Item = objApp
Set colLinks = objSafeApp.Links
With objSafeApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
Set objContact = Nothing
Set objSafeApp.Item = Nothing
Set objSafeApp = Nothing
End Sub

On 7 Nov., 07:11, "Dmitry Streblechenko" <[email protected]>
wrote:
I can only suggest to use Redemption, which does not leave
hanging
references...
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
Thanks for your idea, Ken.
I`m sorry, but there is no change.

On 6 Nov., 21:47, "Ken Slovak - [MVP - Outlook]"
<[email protected]>
wrote:
Peter, see if this is any better:
Public objContacts As Outlook.Items
Public objContact As Outlook.ContactItem
Public objAppointments As Outlook.Items
Public objApp As Outlook.AppointmentItem
Public colLinks As Outlook.Links
Public objLink As Outlook.Link
Sub Test()
Dim oNS As Outlook.NameSpace
Set oNS = Outlook.GetNameSpace("MAPI")
Set objContacts = _
oNS.GetDefaultFolder(olFolderContacts).Items
Set objAppointments = _
oNS.GetDefaultFolder(olFolderCalendar).Items
Call CreateAppointments(1, 230)
Call CreateAppointments(231, 400)
Set objContacts = Nothing
Set objContact = Nothing
Set objAppointments = Nothing
Set objApp = Nothing
Set colLinks = Nothing
Set objLink = Nothing
End Sub
Sub CreateAppointments(ByVal lngFrom As Long, ByVal lngTo As
Long)
Dim lngIndex As Long
For lngIndex = lngFrom To lngTo
Set objContact = objContacts.Item(lngIndex)
Call AddAppointment(objContact)
Set objContact = Nothing
Next
End Sub
Sub AddAppointment(ByVal objContact As Outlook.ContactItem)
Set objApp = objAppointments.Add
Set colLinks = objApp.Links
With objApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
End Sub
Thank you Dmitry, but the error is still there:
Sub Test()
Call CreateAppointments(1, 230)
Call CreateAppointments(231, 400)
End Sub
Sub CreateAppointments(ByVal lngFrom As Long, ByVal lngTo
As
Long)
Dim objContacts As Outlook.Items
Dim objContact As Outlook.ContactItem
Dim lngIndex As Long
Set objContacts =
Outlook.Session.GetDefaultFolder(olFolderContacts).Items
For lngIndex = lngFrom To lngTo
Set objContact = objContacts(lngIndex)
Call AddAppointment(objContact)
Set objContact = Nothing
Next
Sub AddAppointment(ByVal objContact As Outlook.ContactItem)
Dim objAppointments As Outlook.Items
Dim objApp As Outlook.AppointmentItem
Dim colLinks As Outlook.Links
Dim objLink As Outlook.Link
Set objAppointments =
Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
Set objApp = objAppointments.Add
Set colLinks = objApp.Links
With objApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
Set objContact = Nothing
Peter- Zitierten Text ausblenden -
- Zitierten Text anzeigen -- Zitierten Text ausblenden -
- Zitierten Text anzeigen -- Zitierten Text ausblenden -
- Zitierten Text anzeigen -- Zitierten Text ausblenden -
- Zitierten Text anzeigen -- Zitierten Text ausblenden -

- Zitierten Text anzeigen -
 
P

Peter Marchert

Sorry, Dmitry, but I think you didn`t try the code :-(

The reminder starts 5 days ago and the reminder comes up for the last
night.

In OOM the Recurrence Pattern is "every November 4" in RDO "every
November 9 effective 11/4/2007"

Peter

AllDayEvent means it starts at midnight, so by default (unless you set it
otherwise) the reminder time will be set to 15 minutes before the start.
You can explicitly set the ReminderTime property if you want full control
over the reminder.

Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool




You can see what I mean, if you use the following code:
Sub CreateAppointments()
Dim objSession As Object
Dim objAppointments As Object
Dim objAppointment As Object
Set objSession = CreateObject("Redemption.RDOSession")
objSession.MAPIOBJECT = Outlook.Session.MAPIOBJECT
Set objAppointment =
objSession.GetDefaultFolder(olFolderCalendar).Items.Add
With objAppointment
.ReminderSet = True
.Subject = "Test"
.AllDayEvent = True
.Start = Date - 5
Set objRecPattern = .GetRecurrencePattern
objRecPattern.RecurrenceType = olRecursYearly
objRecPattern.PatternStartDate = Date - 5
objRecPattern.NoEndDate = True
.Save
End With
A reminder comes up from midnight of the last day.
Redemption version is 4.5.0.730.

I am not sure what you mean by "but not appear when creating the items".
Do you mean it shoudl nto appear while your codei is still running in a
loop
creating items? Why shouldn't Outlook display a reminder?
I would imagine if you are using OOM, it physically cannot do so sinceit
is
busy with your script, but RDO does not use Outlook, so it is free to
display a reminder.
As for the recurrence description, what version of Redemption are you
using?
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

The reminder should not be deactivated, but not appear when creating
the items. With the code for OOM this is ok, with the same code in RDO
the description of the appointments is different and the reminder for
all created items appears. I think there is the problem. Why could
this be if the code is the same?
Peter
Try to set RDOAppointmentItem.ReminderSet to false
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Thank you Dmitry, this works fine.
But I have another problem. In the code I create recurrence
appointments:
Set objRecPattern = .GetRecurrencePattern
objRecPattern.RecurrenceType = olRecursYearly
objRecPattern.PatternStartDate = dtmBirthday
objRecPattern.NoEndDate = True
With the OOM the description of the appointment is (translated)
"This
appointment occurs every year on the 25th October, starting on 25th
October 2007" and no reminder comes up.
Same code with RDO (objRecPattern then is dimed as object not longer
as Outlook.RecurrencePattern) set the description to "This
appointment
occurs every year on the 25th October, in the period from 25.10.2007
to 02.01.4501." and a reminder comes up. So may be I have to set one
more parameter in RDO?
Peter
I meant the RDO family of objects, which does not rely on OOM at
all.
You will need to change the variable declarations appropriately and
use
something like
set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Outlook.Session.MAPIOBJECT 'make them both
use
the
same session
set objContacts = Session.GetDefaultFolder(olFolderContacts).Items
set objAppointments
=Session.GetDefaultFolder(olFolderCalendar).Items
...
Next version of Redemption will keep track of the open MAPI objects
and
automatically release them when the number gets too high (they are
transparently reopened on demand), so you won't have to go through
the
trouble of setting all objects to Nothing.
Send me an e-mail if you want a beta.
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

How to do that? This code occurs the same error:
Sub AddAppointment(ByVal objContact As Outlook.ContactItem)
Dim objAppointments As Outlook.Items
Dim objApp As Outlook.AppointmentItem
Dim colLinks As Outlook.Links
Dim objLink As Outlook.Link
Dim objSafeApp As Object
Set objAppointments =
Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
Set objSafeApp = CreateObject("SafeOutlook.SecureAppointment")
Set objApp = objAppointments.Add
objApp.Save
objSafeApp.Item = objApp
Set colLinks = objSafeApp.Links
With objSafeApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
Set objContact = Nothing
Set objSafeApp.Item = Nothing
Set objSafeApp = Nothing
End Sub
Peter
On 7 Nov., 07:11, "Dmitry Streblechenko" <[email protected]>
wrote:
I can only suggest to use Redemption, which does not leave
hanging
references...
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Thanks for your idea, Ken.
I`m sorry, but there is no change.
Peter
On 6 Nov., 21:47, "Ken Slovak - [MVP - Outlook]"
<[email protected]>
wrote:
Peter, see if this is any better:
Public objContacts As Outlook.Items
Public objContact As Outlook.ContactItem
Public objAppointments As Outlook.Items
Public objApp As Outlook.AppointmentItem
Public colLinks As Outlook.Links
Public objLink As Outlook.Link
Sub Test()
Dim oNS As Outlook.NameSpace
Set oNS = Outlook.GetNameSpace("MAPI")
Set objContacts = _
oNS.GetDefaultFolder(olFolderContacts).Items
Set objAppointments = _
oNS.GetDefaultFolder(olFolderCalendar).Items
Call CreateAppointments(1, 230)
Call CreateAppointments(231, 400)
Set objContacts = Nothing
Set objContact = Nothing
Set objAppointments = Nothing
Set objApp = Nothing
Set colLinks = Nothing
Set objLink = Nothing
End Sub
Sub CreateAppointments(ByVal lngFrom As Long, ByVal lngTo As
Long)
Dim lngIndex As Long
For lngIndex = lngFrom To lngTo
Set objContact = objContacts.Item(lngIndex)
Call AddAppointment(objContact)
Set objContact = Nothing
Next
End Sub
Sub AddAppointment(ByVal objContact As Outlook.ContactItem)
Set objApp = objAppointments.Add
Set colLinks = objApp.Links
With objApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
End Sub


Thank you Dmitry, but the error is still there:
Sub Test()
Call CreateAppointments(1, 230)
Call CreateAppointments(231, 400)
End Sub
Sub CreateAppointments(ByVal lngFrom As Long, ByVal lngTo
As
Long)
Dim objContacts As Outlook.Items

...

Erfahren Sie mehr »- Zitierten Text ausblenden -

- Zitierten Text anzeigen -
 
D

Dmitry Streblechenko

Hmmm... I can reproduce this, let me play with this later tonight...

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Sorry, Dmitry, but I think you didn`t try the code :-(

The reminder starts 5 days ago and the reminder comes up for the last
night.

In OOM the Recurrence Pattern is "every November 4" in RDO "every
November 9 effective 11/4/2007"

Peter

AllDayEvent means it starts at midnight, so by default (unless you set it
otherwise) the reminder time will be set to 15 minutes before the start.
You can explicitly set the ReminderTime property if you want full control
over the reminder.

Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool




You can see what I mean, if you use the following code:
Sub CreateAppointments()
Dim objSession As Object
Dim objAppointments As Object
Dim objAppointment As Object
Set objSession = CreateObject("Redemption.RDOSession")
objSession.MAPIOBJECT = Outlook.Session.MAPIOBJECT
Set objAppointment =
objSession.GetDefaultFolder(olFolderCalendar).Items.Add
With objAppointment
.ReminderSet = True
.Subject = "Test"
.AllDayEvent = True
.Start = Date - 5
Set objRecPattern = .GetRecurrencePattern
objRecPattern.RecurrenceType = olRecursYearly
objRecPattern.PatternStartDate = Date - 5
objRecPattern.NoEndDate = True
.Save
End With
A reminder comes up from midnight of the last day.
Redemption version is 4.5.0.730.

I am not sure what you mean by "but not appear when creating the
items".
Do you mean it shoudl nto appear while your codei is still running in a
loop
creating items? Why shouldn't Outlook display a reminder?
I would imagine if you are using OOM, it physically cannot do so since
it
is
busy with your script, but RDO does not use Outlook, so it is free to
display a reminder.
As for the recurrence description, what version of Redemption are you
using?
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

The reminder should not be deactivated, but not appear when creating
the items. With the code for OOM this is ok, with the same code in
RDO
the description of the appointments is different and the reminder for
all created items appears. I think there is the problem. Why could
this be if the code is the same?
Peter
Try to set RDOAppointmentItem.ReminderSet to false
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Thank you Dmitry, this works fine.
But I have another problem. In the code I create recurrence
appointments:
Set objRecPattern = .GetRecurrencePattern
objRecPattern.RecurrenceType = olRecursYearly
objRecPattern.PatternStartDate = dtmBirthday
objRecPattern.NoEndDate = True
With the OOM the description of the appointment is (translated)
"This
appointment occurs every year on the 25th October, starting on
25th
October 2007" and no reminder comes up.
Same code with RDO (objRecPattern then is dimed as object not
longer
as Outlook.RecurrencePattern) set the description to "This
appointment
occurs every year on the 25th October, in the period from
25.10.2007
to 02.01.4501." and a reminder comes up. So may be I have to set
one
more parameter in RDO?
Peter
On 7 Nov., 19:05, "Dmitry Streblechenko" <[email protected]>
wrote:
I meant the RDO family of objects, which does not rely on OOM at
all.
You will need to change the variable declarations appropriately
and
use
something like
set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Outlook.Session.MAPIOBJECT 'make them both
use
the
same session
set objContacts =
Session.GetDefaultFolder(olFolderContacts).Items
set objAppointments
=Session.GetDefaultFolder(olFolderCalendar).Items
...
Next version of Redemption will keep track of the open MAPI
objects
and
automatically release them when the number gets too high (they
are
transparently reopened on demand), so you won't have to go
through
the
trouble of setting all objects to Nothing.
Send me an e-mail if you want a beta.
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

How to do that? This code occurs the same error:
Sub AddAppointment(ByVal objContact As Outlook.ContactItem)
Dim objAppointments As Outlook.Items
Dim objApp As Outlook.AppointmentItem
Dim colLinks As Outlook.Links
Dim objLink As Outlook.Link
Dim objSafeApp As Object
Set objAppointments =
Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
Set objSafeApp =
CreateObject("SafeOutlook.SecureAppointment")
Set objApp = objAppointments.Add
objApp.Save
objSafeApp.Item = objApp
Set colLinks = objSafeApp.Links
With objSafeApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
Set objContact = Nothing
Set objSafeApp.Item = Nothing
Set objSafeApp = Nothing
End Sub
Peter
On 7 Nov., 07:11, "Dmitry Streblechenko" <[email protected]>
wrote:
I can only suggest to use Redemption, which does not leave
hanging
references...
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Thanks for your idea, Ken.
I`m sorry, but there is no change.
Peter
On 6 Nov., 21:47, "Ken Slovak - [MVP - Outlook]"
<[email protected]>
wrote:
Peter, see if this is any better:
Public objContacts As Outlook.Items
Public objContact As Outlook.ContactItem
Public objAppointments As Outlook.Items
Public objApp As Outlook.AppointmentItem
Public colLinks As Outlook.Links
Public objLink As Outlook.Link
Sub Test()
Dim oNS As Outlook.NameSpace
Set oNS = Outlook.GetNameSpace("MAPI")
Set objContacts = _
oNS.GetDefaultFolder(olFolderContacts).Items
Set objAppointments = _
oNS.GetDefaultFolder(olFolderCalendar).Items
Call CreateAppointments(1, 230)
Call CreateAppointments(231, 400)
Set objContacts = Nothing
Set objContact = Nothing
Set objAppointments = Nothing
Set objApp = Nothing
Set colLinks = Nothing
Set objLink = Nothing
End Sub
Sub CreateAppointments(ByVal lngFrom As Long, ByVal lngTo
As
Long)
Dim lngIndex As Long
For lngIndex = lngFrom To lngTo
Set objContact = objContacts.Item(lngIndex)
Call AddAppointment(objContact)
Set objContact = Nothing
Next
End Sub
Sub AddAppointment(ByVal objContact As Outlook.ContactItem)
Set objApp = objAppointments.Add
Set colLinks = objApp.Links
With objApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
End Sub


Thank you Dmitry, but the error is still there:
Sub Test()
Call CreateAppointments(1, 230)
Call CreateAppointments(231, 400)
End Sub
Sub CreateAppointments(ByVal lngFrom As Long, ByVal lngTo
As
Long)
Dim objContacts As Outlook.Items

...

Erfahren Sie mehr »- Zitierten Text ausblenden -

- Zitierten Text anzeigen -
 
D

Dmitry Streblechenko

Ah! I see what the problem is. You can work around this by setting the
RecurrencePattern.DayOfMonth property explicitly
Or send me an e-mail if you want an updated version...

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Dmitry Streblechenko said:
Hmmm... I can reproduce this, let me play with this later tonight...

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Sorry, Dmitry, but I think you didn`t try the code :-(

The reminder starts 5 days ago and the reminder comes up for the last
night.

In OOM the Recurrence Pattern is "every November 4" in RDO "every
November 9 effective 11/4/2007"

Peter

AllDayEvent means it starts at midnight, so by default (unless you set it
otherwise) the reminder time will be set to 15 minutes before the start.
You can explicitly set the ReminderTime property if you want full control
over the reminder.

Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool




You can see what I mean, if you use the following code:
Sub CreateAppointments()
Dim objSession As Object
Dim objAppointments As Object
Dim objAppointment As Object
Set objSession = CreateObject("Redemption.RDOSession")
objSession.MAPIOBJECT = Outlook.Session.MAPIOBJECT
Set objAppointment =
objSession.GetDefaultFolder(olFolderCalendar).Items.Add
With objAppointment
.ReminderSet = True
.Subject = "Test"
.AllDayEvent = True
.Start = Date - 5
Set objRecPattern = .GetRecurrencePattern
objRecPattern.RecurrenceType = olRecursYearly
objRecPattern.PatternStartDate = Date - 5
objRecPattern.NoEndDate = True
.Save
End With
A reminder comes up from midnight of the last day.
Redemption version is 4.5.0.730.

I am not sure what you mean by "but not appear when creating the
items".
Do you mean it shoudl nto appear while your codei is still running in
a
loop
creating items? Why shouldn't Outlook display a reminder?
I would imagine if you are using OOM, it physically cannot do so since
it
is
busy with your script, but RDO does not use Outlook, so it is free to
display a reminder.
As for the recurrence description, what version of Redemption are you
using?
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
The reminder should not be deactivated, but not appear when creating
the items. With the code for OOM this is ok, with the same code in
RDO
the description of the appointments is different and the reminder
for
all created items appears. I think there is the problem. Why could
this be if the code is the same?

Try to set RDOAppointmentItem.ReminderSet to false
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
Thank you Dmitry, this works fine.
But I have another problem. In the code I create recurrence
appointments:
Set objRecPattern = .GetRecurrencePattern
objRecPattern.RecurrenceType = olRecursYearly
objRecPattern.PatternStartDate = dtmBirthday
objRecPattern.NoEndDate = True
With the OOM the description of the appointment is (translated)
"This
appointment occurs every year on the 25th October, starting on
25th
October 2007" and no reminder comes up.
Same code with RDO (objRecPattern then is dimed as object not
longer
as Outlook.RecurrencePattern) set the description to "This
appointment
occurs every year on the 25th October, in the period from
25.10.2007
to 02.01.4501." and a reminder comes up. So may be I have to set
one
more parameter in RDO?

On 7 Nov., 19:05, "Dmitry Streblechenko" <[email protected]>
wrote:
I meant the RDO family of objects, which does not rely on OOM at
all.
You will need to change the variable declarations appropriately
and
use
something like
set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Outlook.Session.MAPIOBJECT 'make them both
use
the
same session
set objContacts =
Session.GetDefaultFolder(olFolderContacts).Items
set objAppointments
=Session.GetDefaultFolder(olFolderCalendar).Items
...
Next version of Redemption will keep track of the open MAPI
objects
and
automatically release them when the number gets too high (they
are
transparently reopened on demand), so you won't have to go
through
the
trouble of setting all objects to Nothing.
Send me an e-mail if you want a beta.
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
How to do that? This code occurs the same error:
Sub AddAppointment(ByVal objContact As Outlook.ContactItem)
Dim objAppointments As Outlook.Items
Dim objApp As Outlook.AppointmentItem
Dim colLinks As Outlook.Links
Dim objLink As Outlook.Link
Dim objSafeApp As Object
Set objAppointments =
Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
Set objSafeApp =
CreateObject("SafeOutlook.SecureAppointment")
Set objApp = objAppointments.Add
objApp.Save
objSafeApp.Item = objApp
Set colLinks = objSafeApp.Links
With objSafeApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
Set objContact = Nothing
Set objSafeApp.Item = Nothing
Set objSafeApp = Nothing
End Sub

On 7 Nov., 07:11, "Dmitry Streblechenko" <[email protected]>
wrote:
I can only suggest to use Redemption, which does not leave
hanging
references...
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
Thanks for your idea, Ken.
I`m sorry, but there is no change.

On 6 Nov., 21:47, "Ken Slovak - [MVP - Outlook]"
<[email protected]>
wrote:
Peter, see if this is any better:
Public objContacts As Outlook.Items
Public objContact As Outlook.ContactItem
Public objAppointments As Outlook.Items
Public objApp As Outlook.AppointmentItem
Public colLinks As Outlook.Links
Public objLink As Outlook.Link
Sub Test()
Dim oNS As Outlook.NameSpace
Set oNS = Outlook.GetNameSpace("MAPI")
Set objContacts = _
oNS.GetDefaultFolder(olFolderContacts).Items
Set objAppointments = _
oNS.GetDefaultFolder(olFolderCalendar).Items
Call CreateAppointments(1, 230)
Call CreateAppointments(231, 400)
Set objContacts = Nothing
Set objContact = Nothing
Set objAppointments = Nothing
Set objApp = Nothing
Set colLinks = Nothing
Set objLink = Nothing
End Sub
Sub CreateAppointments(ByVal lngFrom As Long, ByVal lngTo
As
Long)
Dim lngIndex As Long
For lngIndex = lngFrom To lngTo
Set objContact = objContacts.Item(lngIndex)
Call AddAppointment(objContact)
Set objContact = Nothing
Next
End Sub
Sub AddAppointment(ByVal objContact As
Outlook.ContactItem)
Set objApp = objAppointments.Add
Set colLinks = objApp.Links
With objApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
End Sub
Thank you Dmitry, but the error is still there:
Sub Test()
Call CreateAppointments(1, 230)
Call CreateAppointments(231, 400)
End Sub
Sub CreateAppointments(ByVal lngFrom As Long, ByVal
lngTo
As
Long)
Dim objContacts As Outlook.Items

...

Erfahren Sie mehr »- Zitierten Text ausblenden -

- Zitierten Text anzeigen -
 
P

Peter Marchert

Thanks a lot - email is sent to you.

Peter

Ah! I see what the problem is. You can work around this by setting the
RecurrencePattern.DayOfMonth property explicitly
Or send me an e-mail if you want an updated version...

Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool




Hmmm... I can reproduce this, let me play with this later tonight...
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
Sorry, Dmitry, but I think you didn`t try the code :-(
The reminder starts 5 days ago and the reminder comes up for the last
night.
In OOM the Recurrence Pattern is "every November 4" in RDO "every
November 9 effective 11/4/2007"

AllDayEvent means it starts at midnight, so by default (unless you setit
otherwise) the reminder time will be set to 15 minutes before the start.
You can explicitly set the ReminderTime property if you want full control
over the reminder.
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

You can see what I mean, if you use the following code:
Sub CreateAppointments()
Dim objSession As Object
Dim objAppointments As Object
Dim objAppointment As Object
Set objSession = CreateObject("Redemption.RDOSession")
objSession.MAPIOBJECT = Outlook.Session.MAPIOBJECT
Set objAppointment =
objSession.GetDefaultFolder(olFolderCalendar).Items.Add
With objAppointment
.ReminderSet = True
.Subject = "Test"
.AllDayEvent = True
.Start = Date - 5
Set objRecPattern = .GetRecurrencePattern
objRecPattern.RecurrenceType = olRecursYearly
objRecPattern.PatternStartDate = Date - 5
objRecPattern.NoEndDate = True
.Save
End With
End Sub
A reminder comes up from midnight of the last day.
Redemption version is 4.5.0.730.
Peter
I am not sure what you mean by "but not appear when creating the
items".
Do you mean it shoudl nto appear while your codei is still running in
a
loop
creating items? Why shouldn't Outlook display a reminder?
I would imagine if you are using OOM, it physically cannot do so since
it
is
busy with your script, but RDO does not use Outlook, so it is free to
display a reminder.
As for the recurrence description, what version of Redemption are you
using?
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

The reminder should not be deactivated, but not appear when creating
the items. With the code for OOM this is ok, with the same code in
RDO
the description of the appointments is different and the reminder
for
all created items appears. I think there is the problem. Why could
this be if the code is the same?
Peter
Try to set RDOAppointmentItem.ReminderSet to false
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Thank you Dmitry, this works fine.
But I have another problem. In the code I create recurrence
appointments:
Set objRecPattern = .GetRecurrencePattern
objRecPattern.RecurrenceType = olRecursYearly
objRecPattern.PatternStartDate = dtmBirthday
objRecPattern.NoEndDate = True
With the OOM the description of the appointment is (translated)
"This
appointment occurs every year on the 25th October, starting on
25th
October 2007" and no reminder comes up.
Same code with RDO (objRecPattern then is dimed as object not
longer
as Outlook.RecurrencePattern) set the description to "This
appointment
occurs every year on the 25th October, in the period from
25.10.2007
to 02.01.4501." and a reminder comes up. So may be I have to set
one
more parameter in RDO?
Peter
On 7 Nov., 19:05, "Dmitry Streblechenko" <[email protected]>
wrote:
I meant the RDO family of objects, which does not rely on OOMat
all.
You will need to change the variable declarations appropriately
and
use
something like
set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Outlook.Session.MAPIOBJECT 'make themboth
use
the
same session
set objContacts =
Session.GetDefaultFolder(olFolderContacts).Items
set objAppointments
=Session.GetDefaultFolder(olFolderCalendar).Items
...
Next version of Redemption will keep track of the open MAPI
objects
and
automatically release them when the number gets too high (they
are
transparently reopened on demand), so you won't have to go
through
the
trouble of setting all objects to Nothing.
Send me an e-mail if you want a beta.
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

How to do that? This code occurs the same error:
Sub AddAppointment(ByVal objContact As Outlook.ContactItem)
Dim objAppointments As Outlook.Items
Dim objApp As Outlook.AppointmentItem
Dim colLinks As Outlook.Links
Dim objLink As Outlook.Link
Dim objSafeApp As Object
Set objAppointments =
Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
Set objSafeApp =
CreateObject("SafeOutlook.SecureAppointment")
Set objApp = objAppointments.Add
objApp.Save
objSafeApp.Item = objApp
Set colLinks = objSafeApp.Links
With objSafeApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
Set objContact = Nothing
Set objSafeApp.Item = Nothing
Set objSafeApp = Nothing
End Sub
Peter
On 7 Nov., 07:11, "Dmitry Streblechenko" <[email protected]>
wrote:
I can only suggest to use Redemption, which does not leave
hanging
references...
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Thanks for your idea, Ken.
I`m sorry, but there is no change.
Peter
On 6 Nov., 21:47, "Ken Slovak - [MVP - Outlook]"
<[email protected]>
wrote:
Peter, see if this is any better:
Public objContacts As Outlook.Items
Public objContact As Outlook.ContactItem
Public objAppointments As Outlook.Items
Public objApp As Outlook.AppointmentItem
Public colLinks As Outlook.Links
Public objLink As Outlook.Link
Sub Test()
Dim oNS As Outlook.NameSpace
Set oNS = Outlook.GetNameSpace("MAPI")
Set objContacts = _
oNS.GetDefaultFolder(olFolderContacts).Items
Set objAppointments = _
oNS.GetDefaultFolder(olFolderCalendar).Items
Call CreateAppointments(1, 230)
Call CreateAppointments(231, 400)
Set objContacts = Nothing
Set objContact = Nothing
Set objAppointments = Nothing
Set objApp = Nothing
Set colLinks = Nothing
Set objLink = Nothing
End Sub
Sub CreateAppointments(ByVal lngFrom As Long, ByVal lngTo
As

...

Erfahren Sie mehr »- Zitierten Text ausblenden -

- Zitierten Text anzeigen -
 
D

Dmitry Streblechenko

Peter,
I sent an updated version to you.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Thanks a lot - email is sent to you.

Peter

Ah! I see what the problem is. You can work around this by setting the
RecurrencePattern.DayOfMonth property explicitly
Or send me an e-mail if you want an updated version...

Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool




Hmmm... I can reproduce this, let me play with this later tonight...
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
Sorry, Dmitry, but I think you didn`t try the code :-(
The reminder starts 5 days ago and the reminder comes up for the last
night.
In OOM the Recurrence Pattern is "every November 4" in RDO "every
November 9 effective 11/4/2007"

AllDayEvent means it starts at midnight, so by default (unless you set
it
otherwise) the reminder time will be set to 15 minutes before the
start.
You can explicitly set the ReminderTime property if you want full
control
over the reminder.
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

You can see what I mean, if you use the following code:
Sub CreateAppointments()
Dim objSession As Object
Dim objAppointments As Object
Dim objAppointment As Object
Set objSession = CreateObject("Redemption.RDOSession")
objSession.MAPIOBJECT = Outlook.Session.MAPIOBJECT
Set objAppointment =
objSession.GetDefaultFolder(olFolderCalendar).Items.Add
With objAppointment
.ReminderSet = True
.Subject = "Test"
.AllDayEvent = True
.Start = Date - 5
Set objRecPattern = .GetRecurrencePattern
objRecPattern.RecurrenceType = olRecursYearly
objRecPattern.PatternStartDate = Date - 5
objRecPattern.NoEndDate = True
.Save
End With
End Sub
A reminder comes up from midnight of the last day.
Redemption version is 4.5.0.730.
Peter
I am not sure what you mean by "but not appear when creating the
items".
Do you mean it shoudl nto appear while your codei is still running
in
a
loop
creating items? Why shouldn't Outlook display a reminder?
I would imagine if you are using OOM, it physically cannot do so
since
it
is
busy with your script, but RDO does not use Outlook, so it is free
to
display a reminder.
As for the recurrence description, what version of Redemption are
you
using?
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

The reminder should not be deactivated, but not appear when
creating
the items. With the code for OOM this is ok, with the same code in
RDO
the description of the appointments is different and the reminder
for
all created items appears. I think there is the problem. Why could
this be if the code is the same?
Peter
On 8 Nov., 18:28, "Dmitry Streblechenko" <[email protected]>
wrote:
Try to set RDOAppointmentItem.ReminderSet to false
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Thank you Dmitry, this works fine.
But I have another problem. In the code I create recurrence
appointments:
Set objRecPattern = .GetRecurrencePattern
objRecPattern.RecurrenceType = olRecursYearly
objRecPattern.PatternStartDate = dtmBirthday
objRecPattern.NoEndDate = True
With the OOM the description of the appointment is (translated)
"This
appointment occurs every year on the 25th October, starting on
25th
October 2007" and no reminder comes up.
Same code with RDO (objRecPattern then is dimed as object not
longer
as Outlook.RecurrencePattern) set the description to "This
appointment
occurs every year on the 25th October, in the period from
25.10.2007
to 02.01.4501." and a reminder comes up. So may be I have to
set
one
more parameter in RDO?
Peter
On 7 Nov., 19:05, "Dmitry Streblechenko" <[email protected]>
wrote:
I meant the RDO family of objects, which does not rely on OOM
at
all.
You will need to change the variable declarations
appropriately
and
use
something like
set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Outlook.Session.MAPIOBJECT 'make them
both
use
the
same session
set objContacts =
Session.GetDefaultFolder(olFolderContacts).Items
set objAppointments
=Session.GetDefaultFolder(olFolderCalendar).Items
...
Next version of Redemption will keep track of the open MAPI
objects
and
automatically release them when the number gets too high (they
are
transparently reopened on demand), so you won't have to go
through
the
trouble of setting all objects to Nothing.
Send me an e-mail if you want a beta.
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

How to do that? This code occurs the same error:
Sub AddAppointment(ByVal objContact As Outlook.ContactItem)
Dim objAppointments As Outlook.Items
Dim objApp As Outlook.AppointmentItem
Dim colLinks As Outlook.Links
Dim objLink As Outlook.Link
Dim objSafeApp As Object
Set objAppointments =
Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
Set objSafeApp =
CreateObject("SafeOutlook.SecureAppointment")
Set objApp = objAppointments.Add
objApp.Save
objSafeApp.Item = objApp
Set colLinks = objSafeApp.Links
With objSafeApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
Set objContact = Nothing
Set objSafeApp.Item = Nothing
Set objSafeApp = Nothing
End Sub
Peter
On 7 Nov., 07:11, "Dmitry Streblechenko"
<[email protected]>
wrote:
I can only suggest to use Redemption, which does not leave
hanging
references...
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Thanks for your idea, Ken.
I`m sorry, but there is no change.
Peter
On 6 Nov., 21:47, "Ken Slovak - [MVP - Outlook]"
<[email protected]>
wrote:
Peter, see if this is any better:
Public objContacts As Outlook.Items
Public objContact As Outlook.ContactItem
Public objAppointments As Outlook.Items
Public objApp As Outlook.AppointmentItem
Public colLinks As Outlook.Links
Public objLink As Outlook.Link
Sub Test()
Dim oNS As Outlook.NameSpace
Set oNS = Outlook.GetNameSpace("MAPI")
Set objContacts = _
oNS.GetDefaultFolder(olFolderContacts).Items
Set objAppointments = _
oNS.GetDefaultFolder(olFolderCalendar).Items
Call CreateAppointments(1, 230)
Call CreateAppointments(231, 400)
Set objContacts = Nothing
Set objContact = Nothing
Set objAppointments = Nothing
Set objApp = Nothing
Set colLinks = Nothing
Set objLink = Nothing
End Sub
Sub CreateAppointments(ByVal lngFrom As Long, ByVal
lngTo
As

...

Erfahren Sie mehr »- Zitierten Text ausblenden -

- Zitierten Text anzeigen -
 
P

Peter Marchert

Thanks! With the new version it works.

Peter

Peter,
I sent an updated version to you.

Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


Thanks a lot - email is sent to you.

Peter

Ah! I see what the problem is. You can work around this by setting the
RecurrencePattern.DayOfMonth property explicitly
Or send me an e-mail if you want an updated version...
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
Hmmm... I can reproduce this, let me play with this later tonight...
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
Sorry, Dmitry, but I think you didn`t try the code :-(
The reminder starts 5 days ago and the reminder comes up for the last
night.
In OOM the Recurrence Pattern is "every November 4" in RDO "every
November 9 effective 11/4/2007"
Peter
AllDayEvent means it starts at midnight, so by default (unless you set
it
otherwise) the reminder time will be set to 15 minutes before the
start.
You can explicitly set the ReminderTime property if you want full
control
over the reminder.
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

You can see what I mean, if you use the following code:
Sub CreateAppointments()
Dim objSession As Object
Dim objAppointments As Object
Dim objAppointment As Object
Set objSession = CreateObject("Redemption.RDOSession")
objSession.MAPIOBJECT = Outlook.Session.MAPIOBJECT
Set objAppointment =
objSession.GetDefaultFolder(olFolderCalendar).Items.Add
With objAppointment
.ReminderSet = True
.Subject = "Test"
.AllDayEvent = True
.Start = Date - 5
Set objRecPattern = .GetRecurrencePattern
objRecPattern.RecurrenceType = olRecursYearly
objRecPattern.PatternStartDate = Date - 5
objRecPattern.NoEndDate = True
.Save
End With
End Sub
A reminder comes up from midnight of the last day.
Redemption version is 4.5.0.730.
Peter
I am not sure what you mean by "but not appear when creating the
items".
Do you mean it shoudl nto appear while your codei is still running
in
a
loop
creating items? Why shouldn't Outlook display a reminder?
I would imagine if you are using OOM, it physically cannot do so
since
it
is
busy with your script, but RDO does not use Outlook, so it is free
to
display a reminder.
As for the recurrence description, what version of Redemption are
you
using?
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

The reminder should not be deactivated, but not appear when
creating
the items. With the code for OOM this is ok, with the same code in
RDO
the description of the appointments is different and the reminder
for
all created items appears. I think there is the problem. Why could
this be if the code is the same?
Peter
On 8 Nov., 18:28, "Dmitry Streblechenko" <[email protected]>
wrote:
Try to set RDOAppointmentItem.ReminderSet to false
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Thank you Dmitry, this works fine.
But I have another problem. In the code I create recurrence
appointments:
Set objRecPattern = .GetRecurrencePattern
objRecPattern.RecurrenceType = olRecursYearly
objRecPattern.PatternStartDate = dtmBirthday
objRecPattern.NoEndDate = True
With the OOM the description of the appointment is (translated)
"This
appointment occurs every year on the 25th October, starting on
25th
October 2007" and no reminder comes up.
Same code with RDO (objRecPattern then is dimed as object not
longer
as Outlook.RecurrencePattern) set the description to "This
appointment
occurs every year on the 25th October, in the period from
25.10.2007
to 02.01.4501." and a reminder comes up. So may be I have to
set
one
more parameter in RDO?
Peter
On 7 Nov., 19:05, "Dmitry Streblechenko" <[email protected]>
wrote:
I meant the RDO family of objects, which does not rely on OOM
at
all.
You will need to change the variable declarations
appropriately
and
use
something like
set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Outlook.Session.MAPIOBJECT 'make them
both
use
the
same session
set objContacts =
Session.GetDefaultFolder(olFolderContacts).Items
set objAppointments
=Session.GetDefaultFolder(olFolderCalendar).Items
...
Next version of Redemption will keep track of the open MAPI
objects
and
automatically release them when the number gets too high (they
are
transparently reopened on demand), so you won't have to go
through
the
trouble of setting all objects to Nothing.
Send me an e-mail if you want a beta.
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

How to do that? This code occurs the same error:
Sub AddAppointment(ByVal objContact As Outlook.ContactItem)
Dim objAppointments As Outlook.Items
Dim objApp As Outlook.AppointmentItem
Dim colLinks As Outlook.Links
Dim objLink As Outlook.Link
Dim objSafeApp As Object
Set objAppointments =
Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
Set objSafeApp =
CreateObject("SafeOutlook.SecureAppointment")
Set objApp = objAppointments.Add
objApp.Save
objSafeApp.Item = objApp
Set colLinks = objSafeApp.Links
With objSafeApp
.ReminderSet = False
.Subject = objContact.Subject
Set objLink = colLinks.Add(objContact)
.Save
End With
Set objLink = Nothing
Set colLinks = Nothing
Set objApp = Nothing
Set objContact = Nothing
Set objSafeApp.Item = Nothing
Set objSafeApp = Nothing
End Sub
Peter
On 7 Nov., 07:11, "Dmitry Streblechenko"
<[email protected]>
wrote:
I can only suggest to use Redemption, which does not leave
hanging
references...
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Thanks for your idea, Ken.
I`m sorry, but there is no change.
Peter
On 6 Nov., 21:47, "Ken Slovak - [MVP - Outlook]"
<[email protected]>
wrote:
Peter, see if this is any better:
Public objContacts As Outlook.Items
Public objContact As Outlook.ContactItem
Public objAppointments As Outlook.Items
Public objApp As Outlook.AppointmentItem
Public colLinks As Outlook.Links
Public objLink As Outlook.Link
Sub Test()
Dim oNS As

...

Erfahren Sie mehr >>- Zitierten Text ausblenden -

- Zitierten Text anzeigen -
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top