Search DominoPower's 11,420 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
PROGRAMMING POWER
R5: FileOpenDialog and Prompt methods
By Tony Patton

This month we continue our tour through the new LotusScript enhancements in Lotus Release 5.0. We'll look at additions that'll enhance your ability to interact with users.

This article focuses on two additions to the NotesUIWorkspace class: FileOpenDialog and Prompt. These new methods provide features sorely missed in previous releases. We will start with the FileOpenDialog method.

FileOpenDialog
It's always been a pain to work with external files (local hard drive or network drive) with previous versions of Notes, but Release 5 answers our prayers. The new FileOpenDialog method of the NotesUIWorkspace class provides a way to select one or more files from a local or network drive. It has the following syntax:

stringArray = NotesUIWorkspace.OpenFileDialog(boolean [, titleString][, filterString][, directoryString][, fileString])

Here's what each parameter means:

  • boolean: signals whether multiple file selections are allowed (True) or not (False);

  • titleString: title displayed in the dialog box (optional);

  • filterString: string that can be used to limit the type of files displayed (optional);

  • directoryString: the directory in which the dialog box initializes (optional);

  • fileString: the filename you want to appear when the dialog box initializes (optional).

Let's look at an example of how this is used. It allows the user to select multiple files to be deleted. We're going to use the standard Windows file open dialog to allow the user to select and delete multiple files. Figure A shows an example of what the dialog will look like once the code segment is executed.

FIGURE A


Now you can delete all the files you want. Roll over picture for a larger image.

Let's start writing the code. First, declare the variables to be used:

Dim uiwork As New NotesUIWorkspace
Dim filesToDelete As Variant, answer As Integer

It's time to use the FileOpenDialog method. The first parameter is set to True to allow multiple files to be selected. The fourth parameter opens the dialog box in the root of the C drive:

filesToDelete = uiwork.OpenFileDialog(True, "Select file(s) to delete","","c:\")

Next, we want to see if any files were actually selected. If no files were selected, the filesToDelete return variable will be empty. If the user has selected files to be deleted, our routine asks to user to confirm using the MsgBox call. If, in fact, the user confirms, MsgBox will return a 1. Here's the code up through that conditional expression:


1  ·  2  ·  3  ·  Next »
Other articles you might like
Home > Lotus Technologies > LotusScript (64 articles)
   When the debugger won't debug hidden code that isn't hidden
   What to do if the LotusScript debugger won't single-step over code
   Little known traps about Lotus Notes fields
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Application development, William Shatner, and the origin of the universe
The (near) future of Sametime, Quickr, Connections, and Symphony
Inside the IBM Innovations lab
Lotusphere 2010: Hot fixes and cool news for Notes, Domino, and LotusLive
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Five trends for 2010
Latest Lotus Headlines
New Notes/Domino Technotes published about Chile's extended daylight saving time
SnnT: How to prevent Google from listing your Sametime Server
How to send someone an email that shows your calendar availability
"The collection has become invalid"
More XPages onclick event weirdness...
Domino 8.5.1 Fix Pack 1 Interim Fix 1 (8.5.1 FP1 IF1) - DAOS Fixes
Domino Designer 8.5 Tip: Where Working Sets Are Stored
>> Read all the news
More from the ZATZ journals
Computing Unplugged: Make Mafia Wars an offer it can't refuse
David Gewirtz Online: CNN commentary and analysis
OutlookPower: Removing an Office installation that doesn't want to go away
-- Advertisement --

Learn Notes and Domino 8 at your place and pace!
Learn Notes and Domino in your office and/or home! TLCC's highly acclaimed distance learning courses for users, developers, and admins will enhance your career and your resume.

The many included activities and demos will make you a pro! Expert instructor help is a click away.

Click here to try a FREE demo course!!

-- Advertisement --

Struggling with exporting Notes data to spreadsheets? No More!
Try IntelliPRINT, The world's leading Reporting, Dashboards, and Analysis solution for Notes & Domino

  • Don't spend unproductive time maintaining different versions of the same spreadsheet
  • Preserve data integrity and security in multi-user environments
  • Create reports in minutes INSIDE Notes
  • Get freedom from iterative report requests, deliver self-serve capabilities

Experience Reporting, Dashboards, and Analysis INSIDE Notes.

Try IntelliPRINT NOW!

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login