Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2008-06-25
4
Medium Priority
?
282 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 200 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

  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…
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

719 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