?
Solved

Delete all calendar entries in Lotus Notes w/vba.

Posted on 2011-02-14
3
Medium Priority
?
1,311 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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Loops Section Overview

839 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