PRB: Default Extension Ignores File Type in VB Common Dialog (106682)
The information in this article applies to:
- Microsoft Visual Basic Standard Edition for Windows 3.0
- Microsoft Visual Basic Professional Edition for Windows 3.0
- Microsoft Visual Basic Professional Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 16-bit, for Windows 4.0
This article was previously published under Q106682 SYMPTOMS
The common dialog custom control (CMDIALOG.VBX) cannot determine which file
type you choose in the Open or Save As dialog box under List Files of Type.
Your chosen file type correctly displays existing files of that type and
filters out other files. However, Visual Basic code cannot detect which
file type you chose.
Also, the default file name extension set by the DefaultExt property is not
affected by changes you make under List Files of Type. As a result, a file
name that you enter without an extension will take the extension of
DefaultExt instead of your choice under List Files of Type.
The above behavior of File Open and File Save As is different from many
other Windows applications, such as Microsoft Excel. Excel determines which
file-type filter you choose and automatically appends that extension to
any file name that you may enter without an extension.
CAUSE
This behavior is by design in the common dialog control in Visual Basic.
WORKAROUND
Instead of using Visual Basic's common dialog custom control, you can write
your own DLL routine in C to call the Windows common dialog routines
located in COMMDLG.DLL. Then you can call that DLL from Visual Basic.
STATUS
This behavior is by design. A change in the design is under review and
will be considered for inclusion in a future release.
Modification Type: | Minor | Last Reviewed: | 1/8/2003 |
---|
Keywords: | kbprb KB106682 |
---|
|