Lab 11 Creating a Dictionary
In this lab, you create a dictionary and then populate it with a list of filenames provided by the file system object.
Lab Instructions
Open Notepad.exe.
On the first line, type Option Explicit.
Declare the following variables by using the Dim command:
Dim objDictionary Dim objFSO Dim objFolder Dim colFiles Dim objFile Dim colItems Dim colKeys Dim strKey Dim strItem
Use CreateObject to create the dictionary:
Set objDictionary = CreateObject("Scripting.Dictionary")
Create the file system object and assign it to the variable objFSO:
Set objFSO = CreateObject("Scripting.FileSystemObject")
Use the GetFolder method and assign it to the variable objFolder:
Set objFolder = objFSO.GetFolder("C:\scriptingBook")
Select a folder available ...
Get Microsoft® Windows® Scripting Self-Paced Learning Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.