|
|
|
|
|
|
|
|
|
|
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. Click 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:
[ Next ]
|
|
|
|
|
|
-- Advertisement --
2-Minute Tutorials
How do I...
- integrate MS Office or OpenOffice with Notes?
- create cross-tab reports and charts?
- print serial letters and mailing labels?
- create PDFs in Lotus Notes?
Check out the 2-minute tutorials here. |
-- Advertisement --
Virtual Meeting - Integrating Sharepoint With Lotus Notes: Strategic Coexistence
No more hassles accessing SharePoint documents from Notes! Mainsoft SharePoint Integrator combines SharePoint document sharing, collaboration, and record management capabilities with Notes emails. Preview version 1.5 during our October 7th Virtual Meeting. Learn to incorporate Notes emails and attachments into a MOSS-based record management site, without migrating to Outlook.
Register to attend today. |
|
|
|
|
|
|
|
|