lotus-noteslotus-formula

Notes toolbar button to archive selected (email) document


You can archive e-mails immediately by using the menu, Actions > Archive > Archive Selected Documents. How can I create a toolbar button that I can click which will perform the above action?

I've already created toolbar buttons to move documents to folders so I'm semi-familiar with the process of creating a button entering formula language commands.


Solution

  • Not sure what you're question is, but having a stab at it. So you want to put the logic in the "toolbar" so you can run it on any database right ? You would have to be able to call the agent that does the job. Well, if you're doing this on mail files only, you can actually call the command

    @Command([ToolsRunMacro];"Archive\\Archive Selected Documents");
    

    You'll need the double backslash as it's an "escaped" after saving.

    But if you're thinking of trying this to work on any database, you're in a bit of trouble.

    Toolbars have a pretty sloppy way of looking for agents you want to run. Because, if you attempt to run an agent from the toolbar, the formula in the toolbar button assumes the database of the current view you are looking at, as the database with the agent as well.

    This is no better than copying the agent into every other database that you want to run the agent on. That's why the above solution for archive, only works in mail files as the agent should be there in every case.

    Otherwise, you are left with the overhead of copying the required agent around everywhere. To prove the point, a simple test. Create a toolbar button with the following formula.

    @Prompt([Ok];"Hello Notes..";@Implode(@DbName;@Char(13)));
    

    Now open any database. Note that the prompt actually shows you the details of the currently open database. This is where the toolbar button will look when trying to run that archive agent.

    As there is no way to specify in Notes formula command, the database location in the @command([ToolsRunMacro]), we're unable to call a centralised agent to do the job that I think you're postulating.

    A good idea, and a worthwhile problem for the vendor to solve, but this is one many things IBM has never addressed since ...way to long ago.