Constant values defined by MS Office Objects:
Constant for MS Excel FileDialog to open a file is:
msoFileDialogOpen
VBScript does not understand the symbol: "msoFileDialogOpen". Here is how we can find out the value of this constant.
Which class does msoFileDialogOpen
belongs to?
Before we even begin, we need to find which "class" defines the "msoFilDialogOpen" constant, this can be done by:
1. Recognize FileDialog is a shared Office dialog:
a. mso is a good hint: MicroSoft Office
b. Go to On-line manual reference C: (Microsoft Office VB Reference)
2. In the Microsoft Office Object Model page
a. Find the FileDoalog
b. Click on this object
3. In the FileDialog object description:
a. Read that the FileDialog expects a DialogType parameter
b. At the bottom of this page, under property, see DialogType property, click on this
4. In DialogType property page
a. Read that this property returns an MsoFileDialogType constant
5. Click on the MsoFileDialogType link
a. See that msoFileDialogOpen is one of the constants defined in the type.
Remember this information, and now we are ready to find out the value for "MsoFileDialogType.msoFileDialogOpen" by:
What is the value of MsoFileDialogType.msoFileDialogOpen?
1. Start a MS office application (i.e., any of the Word, Excel, etc.)
2. Bring up the Microsoft Visual Basic Editor:
a. Tools->Macro->Visual Basic Editor
3. In Visual Basic Editor:
a. View->Object Browser
a. On the left column select the _class_ name MsoFileDialogType
b. On the right column, find/select msoFileDialogOpen, and now look at the status area, we see that
Const msoFileDialogOpen = 1
This says, the constant's value is 1.