Tip

How to find files on a hard drive or mapped network with LotusScript

Related resources from SearchDomino.com:
Tutorial: 30 LotusScript tips

Top 10 LotusScript tips

LotusScript Reference Center

I wanted to locate a file on either my hard drive or a mapped network drive and import the data into a Lotus Notes database. Because I had already found the code to do the import, I abridged my LotusScript code to provide just the file selection routine, which can be placed in a button or view action.

Placing the LotusScript code in a button gives the Notes user a choice of drives (it defaults to the C: drive, as seen in Figure 1).


Figure 1. Identify the drive you want to select the file from.

Lotus Notes users then receive a list of folders and files matching a pattern, for example .xls. However, this can be changed.

There also is an abort/cancel option at the top of the list that lets you drill down into the next directory to locate the relevant file. An option to move back to the root is also provided as Lotus Notes users drill down into directories. You should select "..", in case a user drills down into the wrong route and cannot find the required file.


Figure 2. Select the file.

Once the file is selected, the full drive, path and filename are returned and displayed on screen (as seen in Figure 3).


Figure 3. The full drive, path and filename are displayed as the selected file.

LotusScript to locate files
(Click on code for enlarged view and script download.)

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip library by member Jerry Eaton. Let others know how useful it was using the rating scale below. Do you have a helpful Lotus Notes Domino tip or code snippet to share? Submit it to our monthly tip contest to be entered to win a prize.

This was first published in July 2008

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.