Solved

How do I create a toolbar button that will remove a folder?

Posted on 2008-06-25
4
268 Views
Last Modified: 2013-12-18
How do I create a button on my toolbar that I can click to remove (delete) the currently selected folder? I understand how to create a custom toolbar but do not how to create a button that will perform the remove folder action.

I am running Lotus Notes client 8.0.1.
0
Comment
Question by:zipwilly05
  • 2
  • 2
4 Comments
 
LVL 22

Expert Comment

by:Bill-Hanson
ID: 21870094
You'll have to use LotusScript for this.

Here's a function that will remove a folder from the current database.  Just change the action type to LotusScript and paste this code into the 'Declarations' module.   Then call the function from the action's click event like this:

Call RemoveFolder("Folder Name")
Sub RemoveFolder(Byval folderName As String)

	

	Dim sess As New NotesSession

	Dim db As NotesDatabase

	Dim folder As NotesView

	Set db = sess.CurrentDatabase

	Set folder = db.GetView(folderName)

	If (folder Is Nothing) Then

		Msgbox "The folder does not exist!"

	Else

		Call folder.Remove

		Set folder = db.GetView(folderName)

		If (folder Is Nothing) Then

			Msgbox "The folder has been removed"

		Else

			Msgbox "Unable to remove the folder!"

		End If

	End If

	

End Sub

Open in new window

0
 

Author Comment

by:zipwilly05
ID: 21878551
I have not written a LotusScript before.

How do I tie the execution of this script to toolbar button? Do I paste something into the Formuia box of the dialog that appears when I create a new toolbar button (see attachment)?

Where is the action that you reference in your response?
snap033.bmp
0
 
LVL 22

Accepted Solution

by:
Bill-Hanson earned 50 total points
ID: 21878681
Sorry.  I answered assuming you were adding a button to an Action Bar in a Notes application.

There is no solution for what you are trying to do since you can only use @Formula in the toolbar and @Formula does not have any fuctions for removing a folder.

I usually just right-click on the folder name and select "Remove Folder".
0
 

Author Closing Comment

by:zipwilly05
ID: 31470761
I did not realize that command was available. Your answer is most helpful.
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

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

914 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

17 Experts available now in Live!

Get 1:1 Help Now