Shorten a long path
By: Gordon F. MacLeod Date: 01/11/1997
File:

shortenpath.zip

Size:

480 bytes

Download now!

This function will shorten a directory path to a custom number of maximum characters. It is used in many ways, for example in most applications to show long path in the recent files list in the File menu.

Syntax

LongDirFix(dirpath)

Parameters

dirpath: a long directory path you want to shorten

Type of data

String

Returns

Shortened directory path.

-

Example:

ShortDir = LongDirFix("C:\MyDocuments\Home\Text Files\MyFile.Doc", 40)

ShortDir will be C:\...\Home\Text Files\MyFile.Doc.

The function is contained in a module. You can cut and paste it in any program of yours.

Click Here!


Visual Basic Programming Zone is a website by Lorenzo Dalla Vecchia.
Webmaster's e-mail: webmaster@vbprogzone.cjb.net
Hosted by InWind: www.inwind.it