Private
Sub
FillUF_Kom()
Dim
x&, strVariable$, txtDatei_Arr$(), Datei$
Dim
s1$, s2$, s3$, S&, E&
Dim
I&
With
Me
.CB_Kom_1
.Clear
.ColumnCount = 2
.ColumnWidths =
"200"
End
With
With
Me
.CB_Kom_2
.Clear
.ColumnCount = 2
.ColumnWidths =
"200"
End
With
With
Me
.CB_Kom_3
.Clear
.ColumnCount = 2
.ColumnWidths =
"200"
End
With
Datei = ActiveDocument.AttachedTemplate.Path &
"\UF_Kommunikation.txt"
S = 1
Open Datei
For
Input
As
1
While
Not
EOF(1)
Line Input #1, strVariable
E = Len(strVariable)
For
I = 1
To
E
If
Mid(strVariable, I, 1) =
","
Then
ReDim
Preserve
txtDatei_Arr(x)
txtDatei_Arr(x) = Mid(strVariable, S, I - S)
x = x + 1
S = I + 1
ElseIf
I = E
Then
ReDim
Preserve
txtDatei_Arr(x)
txtDatei_Arr(x) = Mid(strVariable, S, E - S + 1)
x = x + 1
End
If
Next
Me
.CB_Kom_1.AddItem txtDatei_Arr(x - 1)
Me
.CB_Kom_2.AddItem txtDatei_Arr(x - 2)
Me
.CB_Kom_3.AddItem txtDatei_Arr(x - 3)
Wend
Close 1
End
Sub