Solved

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

Posted on 2008-06-25
4
265 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

705 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

14 Experts available now in Live!

Get 1:1 Help Now