Solved

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

Posted on 2008-06-25
4
280 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
[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
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying 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

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…
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.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

630 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