Solved

Delete all calendar entries in Lotus Notes w/vba.

Posted on 2011-02-14
3
1,269 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

713 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