![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
Hello,
I`m trying to create birthday appointments the same way like Outlook does if you add a birthday in a contact. With this code I´m not able to do so: Sub CreateBirthday() Dim objAppointment As Outlook.AppointmentItem Dim objRecPattern As Outlook.RecurrencePattern Set objAppointment = Outlook.Session.GetDefaultFolder(olFolderCalendar) .Items.Add With objAppointment .ReminderSet = True .Subject = "Test" .AllDayEvent = True .Start = CLng(27820) ' 3/1/1976 Set objRecPattern = .GetRecurrencePattern objRecPattern.RecurrenceType = olRecursYearly objRecPattern.PatternStartDate = CLng(27820) objRecPattern.NoEndDate = True .Save End With Set objRecPattern = Nothing Set objAppointment = Nothing End Sub I expected a recurrence like: End after: End by: None but I get a recurrence like this: End after: 10 End by: Fri 3/1/1985 Is the used code wrong or does a workarround exists to get the same result like Outlook? I ask this question because my program creates birthday in that way and a user have problems with the appointments after synchronizing with his handy. May be it has to do with the way I create the items? Btw: Setting the occurrences takes no effect (objRecPattern.Occurrences = 1), it is still 10. Thanks Peter -- Infos, workshops & software for Outlook(R): www.outlook-stuff.com |
#2
|
|||
|
|||
![]()
Your code works prefectly fine on Outlook 2007 - weird.
-- Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Peter Marchert" wrote: Hello, I`m trying to create birthday appointments the same way like Outlook does if you add a birthday in a contact. With this code I´m not able to do so: Sub CreateBirthday() Dim objAppointment As Outlook.AppointmentItem Dim objRecPattern As Outlook.RecurrencePattern Set objAppointment = Outlook.Session.GetDefaultFolder(olFolderCalendar) .Items.Add With objAppointment .ReminderSet = True .Subject = "Test" .AllDayEvent = True .Start = CLng(27820) ' 3/1/1976 Set objRecPattern = .GetRecurrencePattern objRecPattern.RecurrenceType = olRecursYearly objRecPattern.PatternStartDate = CLng(27820) objRecPattern.NoEndDate = True .Save End With Set objRecPattern = Nothing Set objAppointment = Nothing End Sub I expected a recurrence like: End after: End by: None but I get a recurrence like this: End after: 10 End by: Fri 3/1/1985 Is the used code wrong or does a workarround exists to get the same result like Outlook? I ask this question because my program creates birthday in that way and a user have problems with the appointments after synchronizing with his handy. May be it has to do with the way I create the items? Btw: Setting the occurrences takes no effect (objRecPattern.Occurrences = 1), it is still 10. Thanks Peter -- Infos, workshops & software for Outlook(R): www.outlook-stuff.com |
#3
|
|||
|
|||
![]()
On 7 Dez., 21:54, Eric Legault [MVP - Outlook]
wrote: Your code works prefectly fine on Outlook 2007 - weird. Please have a closer look to the created appointment, especially to the appointments recurrence and the posted properties. Peter -- Infos, workshops & software for Outlook(R): www.outlook-stuff.com |
#4
|
|||
|
|||
![]()
Peter,
Comment out this line and try it again: objRecPattern.NoEndDate = True -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Peter Marchert" wrote in message ... On 7 Dez., 21:54, Eric Legault [MVP - Outlook] wrote: Your code works prefectly fine on Outlook 2007 - weird. Please have a closer look to the created appointment, especially to the appointments recurrence and the posted properties. Peter -- Infos, workshops & software for Outlook(R): www.outlook-stuff.com |
#5
|
|||
|
|||
![]()
Thanks, Ken.
I tried it but it`s the same result. I tested it with 2003 (English) and SP3. Peter On 8 Dez., 19:05, "Ken Slovak - [MVP - Outlook]" wrote: Peter, Comment out this line and try it again: objRecPattern.NoEndDate = True -- Ken Slovak [MVP - Outlook]http://www.slovaktech.com Author: Professional Programming Outlook 2007 Reminder Manager, Extended Reminders, Attachment Optionshttp://www.slovaktech.com/products.htm "Peter Marchert" wrote in message ... On 7 Dez., 21:54, Eric Legault [MVP - Outlook] wrote: Your code works prefectly fine on Outlook 2007 - weird. Please have a closer look to the created appointment, especially to the appointments recurrence and the posted properties. Peter -- Infos, workshops & software for Outlook(R):www.outlook-stuff.com- Zitierten Text ausblenden - - Zitierten Text anzeigen - |
#6
|
|||
|
|||
![]()
That's odd. I tested it here with that same exact setup and got a recurring
item with no end (infinite series). Did you delete any existing instances of that item before testing with that line commented out? -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Peter Marchert" wrote in message ... Thanks, Ken. I tried it but it`s the same result. I tested it with 2003 (English) and SP3. Peter |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
EXPORT BIRTHDAYS INTO OUTLOOK | PUZZLED IN ORLANDO | Outlook - Using Contacts | 3 | November 8th 07 03:52 AM |
Outlook birthdays | Danie Eksteen | Outlook - Using Contacts | 2 | June 13th 07 02:55 PM |
How do I sort my birthdays by month I have 500 of them? Outlook | Thomas | Outlook - Using Contacts | 2 | October 31st 06 01:47 AM |
why does Outlook assign times to birthdays | mbryce52 | Outlook - Calandaring | 1 | February 20th 06 03:04 PM |
How do I automatically create Venutian & Mars Birthdays from contact form | BJ | Outlook - Using Forms | 0 | January 13th 06 03:05 AM |