Solved

Delete all calendar entries in Lotus Notes w/vba.

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

757 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

18 Experts available now in Live!

Get 1:1 Help Now