Hello
I have been trying to get this Macro to work but I have had no luck.
It works fine, but when I put my word file with the macro in “My templates” it shows me an error:
Run-time error 5941
The request member of the collection does not exist.
The error occurs in this line:
For Each Zelle In ActiveDocument.Tables(1).Rows(cboAOrt.ListIndex + 2).Cells
Dim Zelle As Cell
Dim Bereich As Range
I = 0
If cboAOrt.ListIndex = -1 Then cboAOrt.ListIndex = 0
For Each Zelle In ActiveDocument.Tables(1).Rows(cboAOrt.ListIndex + 2).Cells
Set Bereich = ActiveDocument.Range(Start:=Zelle.Range.Start, End:=Zelle.Range.End - 1)
Select Case I
Case 0
Nr = 1
Zweigstelle = Bereich.Text
Case 1
Strasse = Bereich.Text
Case 2
Ort = Bereich.Text
Case 3
Telefon = Bereich.Text
Case 4
Telefax = Bereich.Text
Case 5
Mail = Bereich.Text
Case 6
Name = Bereich.Text
Case 7
Titel = Bereich.Text
End Select
I = I + 1
Next Zelle
ActiveDocument.Close
Has anybody any ideas why?
Thanks for any help
I have been trying to get this Macro to work but I have had no luck.
It works fine, but when I put my word file with the macro in “My templates” it shows me an error:
Run-time error 5941
The request member of the collection does not exist.
The error occurs in this line:
For Each Zelle In ActiveDocument.Tables(1).Rows(cboAOrt.ListIndex + 2).Cells
Dim Zelle As Cell
Dim Bereich As Range
I = 0
If cboAOrt.ListIndex = -1 Then cboAOrt.ListIndex = 0
For Each Zelle In ActiveDocument.Tables(1).Rows(cboAOrt.ListIndex + 2).Cells
Set Bereich = ActiveDocument.Range(Start:=Zelle.Range.Start, End:=Zelle.Range.End - 1)
Select Case I
Case 0
Nr = 1
Zweigstelle = Bereich.Text
Case 1
Strasse = Bereich.Text
Case 2
Ort = Bereich.Text
Case 3
Telefon = Bereich.Text
Case 4
Telefax = Bereich.Text
Case 5
Mail = Bereich.Text
Case 6
Name = Bereich.Text
Case 7
Titel = Bereich.Text
End Select
I = I + 1
Next Zelle
ActiveDocument.Close
Has anybody any ideas why?
Thanks for any help