National holidays in calendar

How can I get Notes calendar to mark all national holidays (christmas day, etc.) for a particular country, say Sweden?
AndreasHagglundAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

capperCommented:
You don't specify whether you are running r4.x or r5. In r5 there is a setting in the Domino Directory that will automatically populate entered holidays in the Notes calendars that are assigned to that setup profile.

For r4.x you need to get the users to add the calendar entries. We've written a script that will do just that. I've attached the script code. Put this is a button on an email and have the send it to all users. The script adds a Profile document so that the user can't add the holidays again and again. It also deletes the email when it's done.

I use this script to add the corporation's holidays to the user's calendar.

Sub Click(Source As Button)
      
      Dim session As New notessession
      
      Set db = session.currentdatabase
      
      Set docprofile =db.GetProfileDocument("Holiday Update",session.username)
      
      stringholiday2000 = docprofile.profileholiday2000(0)
      
      If stringholiday2000 = "" Then
            
            docprofile.profileholiday2000 = "Done"
            docprofile.save True, True
            
' Initialize the pop up box message to :            
            msg = "The following days have been added to your Notes Calendar : " & Chr(13) & Chr(13)
            
          'Good Friday
            AddHoliday "Good Friday" ,"04/21/2000" ,148
            
              'Victoria Day
            AddHoliday "Victoria Day" ,"05/22/2000",115
            
              'Canada Day
            AddHoliday "Canada Day" ,"07/3/2000",159
            
              'Civic Holiday
            AddHoliday "Civic Holiday / Simcoe Day" ,"08/7/2000",115
            
              'Labour Day
            AddHoliday "Labour Day" ,"09/4/2000",115
            
              'Thanksgiving Day
            AddHoliday "Thanksgiving Day" ,"10/9/2000",115
            
                 'Boxing Day
            AddHoliday "Boxing Day" ,"12/26/2000",85
            
              'Christmas Day
            AddHoliday "Christmas Day" ,"12/25/2000",146
            
               'New Years Day
            AddHoliday "New Year's Day Holiday" ,"01/1/2001",85
            
            
            msg = msg & Chr(13) &_
            "The 2000 floating stat day is to be taken at the employee's discretion with Manager approval" & Chr(13) &_
            "prior to December 31,2000" & Chr(13)
            
            Messagebox msg
            
            
      Else
            Messagebox "Dates already set!"
            
      End If
      
     'Delete the document now..
      
      Dim workspace As New notesuiworkspace
      Dim uidoc As notesuidocument
      Set uidoc = workspace.currentdocument
      Call uidoc.deletedocument
      
End Sub

Sub AddHoliday(hName ,d1 As String,icon As Integer)
      
      Dim session As New notessession
      Dim d2,d3 As String
      
      d2 = d1 & " 11:59:59 PM"
      d3 = d1 & " 12:01:01 AM"
      d1 = d3
      
      Set doc = New notesdocument(db)
      
      Set datetime1 = New notesdatetime(d1)
      Set datetime2 = New notesdatetime(d2)
      Set datetime = New notesdatetime(d3)
      
      doc.subject = hName
      doc.form = "Appointment"
      doc.appointmenttype = "2"
      Set doc.calendardatetime = datetime1
      Set doc.startdatetime = datetime1
      Set doc.startdate = datetime1
      doc.chair = session.username
      doc.duration = 1
      Set doc.enddatetime = datetime2
      doc.from = session.username
      doc.excludefromview = "D"
      doc.ORGTABLE = "P0"
      doc.broadcast = ""
      doc.Categories = ""
      Call doc.appenditemvalue ("_Viewicon", icon)
      doc.bookfreetime = ""
      Call doc.appenditemvalue ("$Busyname",session.username )  
      Call doc.appenditemvalue ("$BusyPriority", "1")
      Call doc.appenditemvalue ("$NoPurge", datetime1)
      Call doc.appenditemvalue ("$Publicaccess", "1")
      doc.save True, True
      
'            Append the holiday to the pop up box message
      msg = msg & hName & " " & Format$(d1,"mmmm d, yyyy") & Chr(13)
      
End Sub
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.