This page provides the detailed code and descriptions required for the Common Dialog GetOpenFileName API, as well as showing how to retrieve the constituent parts of the file string returned.
Code comments are at a minimum here.
These APIs will not work on NT if vbNullString is used. If multiselect, 'the first member is the path, and the 'remaining members are the files under 'that path selected. As String 'take a string separated by nulls, 'split off 1 item, and shorten the string 'so the next item is ready for removal. This is even true if the constant is defined As Long in the declare. If you use this constant in your apps and the file dialog either does not appear or the app crashes without an error, check this value.