Solved

Delete all calendar entries in Lotus Notes w/vba.

Posted on 2011-02-14
3
1,227 Views
Last Modified: 2013-12-18
Hello,

I am trying to find a method to delete all calendar entries from a Lotus Notes. I currently create calendar entries within Excel/VB, but need to clear the calendar and repopulate it daily with new entries. Is there a way to delete all calander only entries?

Thank You
0
Comment
Question by:GJDuquette
  • 2
3 Comments
 
LVL 22

Accepted Solution

by:
mbonaci earned 500 total points
ID: 34894759
Do you have access to Domino Designer?
It would be easier to schedule an agent that would delete all calendar entries.

If not, you can do it from VBA like this (hasn't been tested, so be careful):


Sub DeleteAllNotesCalendarEntries()
	Dim s As Object
	Dim db As Object
	Dim v As Object
	Dim cur As Object
	Dim tmpdoc As Object
	Dim mailServer As String
	Dim mailFile As String

'do this part (getting mail db) your way
	Set s = CreateObject("Lotus.NotesSession")
	s.Initialize("")

	mailServer = sess.GetEnvironmentString("MailServer", True)
	mailFile = sess.GetEnvironmentString("MailFile", True)

	Set db = sess.GetDatabase(mailServer, mailFile, False)

	Set v = db.GetView("Calendar")
	Set cur = v.GetLastDocument()
	Do Until cur Is Nothing
		Set tmpdoc = cur
		Set cur = v.GetPrevDocument(cur)
		Call tmpdoc.RemovePermanently(True)
	Loop
End Sub

Open in new window

0
 
LVL 22

Expert Comment

by:mbonaci
ID: 34894767
In lines 14, 15, 17
replace "sess"
with "s"
0
 

Author Closing Comment

by:GJDuquette
ID: 34896144
That is exactly what I needed. THANK YOU!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Connect SQL Server from Lotus Domino Application 7 340
Lotus Domino server 9 7 69
Using @Prompt in a Queryclose Event 14 83
Domino Website - Redirection 12 52
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now