Hi All,
How do I use the INIFile object. I am trying to get the GetSectionNames example
working from the ap developers manual with no success what so ever. I created
the structure in notepad and saved it as a text file with a dot INI extention
called test.ini.
The structure Follows.
[Bosses]
boss1=Doug
boss2=Dan
[Support]
name1=Mike
name2=Raul
name3=Aaron
I then wrote the following VBScript to attempt to retrieve the section names. I
keep getting the error object doesn't support this property or wrong number of
arguments, and when I tried without calling the file system object, I got the
error no object or some such.
Begin VBScript
Dim MyHotkey
Set MyHotkey = Keyboard.RegisterHotkey("Control-Shift-Windows-i", "ReadIni")
Sub ReadIni()
Dim FSO, ScriptPath
Const ForReading = 1
ScriptPath = ClientInformation.ScriptPath & "\test.ini"
Set FSO = CreateObject("Scripting.FileSystemObject")
Set INIFile = FSO.OpenTextFile(ScriptPath, ForReading)
iniString = INIFile.GetINISectionNames()
iniArray = Split(iniString, vbNullChar)
For Each iniName In iniArray
Speak iniName
Next
End Sub
Output should be bosses and support.
Please help, I have no ideas left here apart from just writing a routine in
VBScript to do the job of this object.
Warm regards.
Martin Webster.