PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming BIRTHDAY IN CALENDER

Reply

BIRTHDAY IN CALENDER

 
Thread Tools Rate Thread
Old 07-11-2004, 12:35 AM   #1
E.Zenker
Guest
 
Posts: n/a
Default BIRTHDAY IN CALENDER


i found this code on outlook.net
can anyone be so kind and help me to extend the code to

->check if the birthday is already in the calender
->if it is there
->go to the next contakt.

To avoid double birthdayentries.

Thanks for your replay
E.Zenker

Sub BirthdayImport()
' Quelle: Unbekannter Autor - Vielen Dank!
' Ich habe nur die Kommentare und die Messageboxen hinzugefügt

MsgBox "Dieses Makro erzeugt jährliche Termine aus den Geburtstagen der
Kontakte." & vbCrLf & "Wählen Sie im folgenden Dialog den Kontakteordner
aus, den dieses Makro durchsuchen soll.", vbInformation, "Geburtstage im
Kalender eintragen"


Dim myFolder As MAPIFolder
' Öffne Ordner-Dialog zum Auswählen des Kontakte-Ordners
Set myFolder = Session.PickFolder
For i = myFolder.Items.Count To 1 Step -1
If myFolder.Items(i).Class = 40 Then
myFolder.Items(i).Display
' den richtigen Geburtstag in mybirthday merken
mybirthday = myFolder.Items(i).Birthday
' Geburtstag mit beliebigem Datum überschreiben,
' um eine Änderung zu erzeugen
myFolder.Items(i).Birthday = "12.12.2000 "
' nun wieder richtiges Datum aus mybirthday eintragen
myFolder.Items(i).Birthday = mybirthday
' Kontakt erneut speichern.
' Jetzt arbeitet Outlook im Hintergrund automatisch und erstellt
' einen jährlichen Eintrag im Kalender
myFolder.Items(i).Save
' Kontakt schließen
myFolder.Items(i).Close 0
End If
' zum nächsten Kontakt gehen und alles wieder von vorne
Next i

MsgBox "Fertig!" & vbCrLf & "Es wurden " & myFolder.Items.Count & " Kontakte
durchsucht.", vbInformation, "Information"


End Sub




  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

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