![]() GetFileName(True, "*.txt", "Total Visual SourceBook Example of File Open", "Text files (*.txt)|*.txt|All Files (*.*)|*.*") ![]() ' Use the GetFileName method to Display the file open dialog and retrieve the file name ' This method accepts parameters rather than requiring the class properties to be set. ' Comments: Examples of using the CFileDialog class to invoke the Windows API Common Control for selecting a file or files from the File Dialog in VBA and VB6.Ĭonst cstrSamplePath As String = "C:\Total Visual SourceBook 2013\Samples\" ' Then run the procedure by putting the cursor in the procedure and pressing: ' F5 to run it, or ' F8 to step through it line-by-line (see the Debug menu for more options) ' Example of CFileDialog ' ' To use this example, create a new module and paste this code into it. Return the path, then the file names separated by spaces: e.g.: C:\Total Visual SourceBook\ install.log readme.txt. ![]() If multiple files were selected, TrimNulls Get the passed string, terminated at the first single or double null character. This function eliminates the need to setĭisplay the file Open/Save common dialog. Get the initial directory (folder) path where the dialog opens.ĭisplay the Windows file Open/Save common dialog and retrieve the file name. Use this property to provide the user with a list of file types that can be selected when the Declarations and private variables for the CFileDialog class.
0 Comments
Leave a Reply. |