OnProgress Event  
 

The OnProgress event is generated the file contents are encoded or decoded.

Syntax

Sub object_OnProgress ( [Index As Integer,] ByVal FileName As Variant, ByVal FileSize As Variant, ByVal FileProcessed As Variant, ByVal Percent As Variant )

Remarks

The OnProgress event is generated as files are being encoded or decoded. For large files, this event can be used to update a progress bar or other user-interface control to provide the user with some visual feedback. The arguments to this event are:

FileName
The name of the file currently being encoded or decoded.
FileSize
The size of the file in bytes.
FileProcessed
The number of bytes in the file which have been encoded or decoded.
Percent
The percentage of data in the file which has been encoded or decoded, expressed as an integer value between 0 and 100, inclusive.

Note that this event is guaranteed to fire at least twice, immediately before the encoding or decoding process begins, and after it has completed. To prevent an application from being flooded with OnProgress events during the course of the encoding process, the control meters the time intervals at which this event is triggered. Unless the file is very large, it is not uncommon for interim events to not fire during the decoding or encoding process.

See Also

DecodeFile Method, EncodeFile Method