Solved

Delete all calendar entries in Lotus Notes w/vba.

Posted on 2011-02-14
3
1,279 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

707 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