Hi Roderick
Karl Peterson has a recently-updated INI-file class on his website, which
should do all you need. Go to
http://vb.mvps.org/samples/project.asp?id=kpini

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
>I have a userform in a Word 2002 template with a combobox populated by
> hard coding the various list items within the procedure.
[quoted text clipped - 26 lines]
>
> Roderick O'Regan
>What I was thinking about is whether there is a routine which looks at
>all of the section names and can load these into a combo box (without
>the brackets, of course)?
>
>Roderick O'Regan
Dear Roderick
heres some long unused code
Public Declare Function GetAllProfileString Lib "kernel32" Alias
"GetPrivateProfileStringA" (ByVal lpApplicationName As Any, ByVal
lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString
As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
'? split(getSections(),vbnullchar)(0) => Jones
'? split(getSections(),vbnullchar)(1) => Smith
Public Function getSections()
On Local Error GoTo getSectionsERR
Dim strRet As String
Dim lngRet As Long
strRet = String(255, 0)
'Ini is the Name of the containing Document/Template in this Example
ini = Left$(ThisDocument.FullName, Len(ThisDocument.FullName) - 3)
& "ini"
lngRet = GetAllProfileString(vbNullString, "", "", strRet,
Len(strRet), ini)
If lngRet Then
getSections = Left$(strRet, lngRet)
End If
getSectionsOUT:
Exit Function
getSectionsERR:
getSections = False
Resume getSectionsOUT
End Function
hth
Ali Bi
Norman Götz
Roderick O'Regan - 02 Mar 2005 08:53 GMT
Thanks for the great help Jonathan and Ali (Norman). Time to try some
of this stuff out!
Regards
Roderick
>>What I was thinking about is whether there is a routine which looks at
>>all of the section names and can load these into a combo box (without
[quoted text clipped - 36 lines]
>Ali Bi
>Norman Götz