A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

I need a programming hint for changing many Birthdays in batch



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 30th 06, 05:38 PM posted to microsoft.public.outlook.program_vba
Mixx
external usenet poster
 
Posts: 2
Default I need a programming hint for changing many Birthdays in batch

Hi,

I am not a programmer at all but have *a lot* in Outlook (12 years
worth) and learned to write primitive macros to do chores on a number
of selected entries. Copied from bits and pieces on the WEB, without
really understanding what I am doing. But it works for my purposes.

My current problem: got a Blackberry (BB) for Email. It is known that
BB does not synch calendar entries before 1970. I have about 100
Birthdays (recurring yearly) that *start* before 1970. These do not
show up on the BB.

I thought I just select these entries and change their Start date to,
say, 1/1/2000 and then the'll show up. Well, it does not work with my
primitive methods. Can somebody give me a hint why. The following code
is one I use many time to batch change entries.

....
Dim objOL As Outlook.Application
Dim objSelection as Outlook.Selection
Dim Item As Outlook.AppointmentItem
Dim myDate As Date
....

Set objOL = CreateObject("Outlook.Application")
Set objSelection = obj.OLActiveExplorer.Selection

For Each Item In objSelection
Item.Class 0 Then '
probably not really needed

MsgBox (Item.Start)
myDate = DateValue("1. Januar 2006") ' German Date
format, is OK
MsgBox (myDate)

Item.Start = myDate
Item.Save

MsgBox (Item.Start)

End If
Next

The problem: The first MsgBox show that the value is as in the
Appointment entry (OK). The second date value (what I want) is also OK.
Third box: shows that assignment does not happen (it really doesn't),
even though I saved the value. Whatever I do, the new date does not get
assigned to the entry.

What am I doing wrong? Thanks for any hint.

Mixx

  #2  
Old May 1st 06, 01:43 PM posted to microsoft.public.outlook.program_vba
Michael Bednarek
external usenet poster
 
Posts: 28
Default I need a programming hint for changing many Birthdays in batch

On 30 Apr 2006 08:38:57 -0700, "Mixx" wrote in
microsoft.public.outlook.program_vba:

I am not a programmer at all but have *a lot* in Outlook (12 years
worth) and learned to write primitive macros to do chores on a number
of selected entries. Copied from bits and pieces on the WEB, without
really understanding what I am doing. But it works for my purposes.

My current problem: got a Blackberry (BB) for Email. It is known that
BB does not synch calendar entries before 1970. I have about 100
Birthdays (recurring yearly) that *start* before 1970. These do not
show up on the BB.

I thought I just select these entries and change their Start date to,
say, 1/1/2000 and then the'll show up. Well, it does not work with my
primitive methods. Can somebody give me a hint why. The following code
is one I use many time to batch change entries.

...
Dim objOL As Outlook.Application
Dim objSelection as Outlook.Selection
Dim Item As Outlook.AppointmentItem
Dim myDate As Date
...

Set objOL = CreateObject("Outlook.Application")
Set objSelection = obj.OLActiveExplorer.Selection


I assume this really reads:
Set objSelection = objOL.ActiveExplorer.Selection

For Each Item In objSelection
Item.Class 0 Then ' probably not really needed

MsgBox (Item.Start)
myDate = DateValue("1. Januar 2006") ' German Date format, is OK
MsgBox (myDate)

Item.Start = myDate
Item.Save

MsgBox (Item.Start)

End If
Next

The problem: The first MsgBox show that the value is as in the
Appointment entry (OK). The second date value (what I want) is also OK.
Third box: shows that assignment does not happen (it really doesn't),
even though I saved the value. Whatever I do, the new date does not get
assigned to the entry.

What am I doing wrong? Thanks for any hint.


According to my tests, this should really bring up the error message:
Run-time error -348110843 (eb404005): You don't have the permission to
move this item.

Apparently, this happens for recurring items. In that case, you have to
modify the recurrence pattern. See Ahmed's solution at Sue Mosher's
website: http://www.outlookcode.com/codedetail.aspx?id=897 for
details.

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"
  #3  
Old May 1st 06, 04:01 PM posted to microsoft.public.outlook.program_vba
Mixx
external usenet poster
 
Posts: 2
Default I need a programming hint for changing many Birthdays in batch

Thanks, Michael!

Indeed, one has to change the PatternStartDate Variable in the
RecurrencePattern. In my BlackBerry problem I had to shift the YEAR of
it to after 1970.

Thanks a million, Mixx

PS: I never got the error message about permissions, though.

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch file blocked Nananana Outlook - General Queries 2 March 12th 06 09:21 PM
Batch sending in Outlook???? Peter R. Adler Outlook - General Queries 2 March 1st 06 09:23 PM
Programming changes to XML properties Ray Jackson Outlook and VBA 1 February 7th 06 02:06 PM
Next Step in Programming for Office C.W. Billow Outlook and VBA 1 January 23rd 06 03:24 PM
Programming form Colin Coady Outlook - Calandaring 3 January 19th 06 04:21 AM


All times are GMT +1. The time now is 09:22 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.