Hey
I'm new with vba word. I want to run trough tables and change some properties. I have a document with around 100 tables and when i start the makro, the word document has an error and shuts down after 20 - 30 tables. Can someone tell me why?
This is my code for it:
Code:
Sub Tabellen_formatieren()
Dim i As Integer
For i = 1 To ActiveDocument.Tables.Count
ActiveDocument.Tables(i).Select
With ActiveDocument.Tables(i).Range.Font
.Name = "Arial"
.Size = 10
.ColorIndex = wdBlack
End With
With ActiveDocument.Tables(i)
.PreferredWidthType = wdPreferredWidthPercent
.PreferredWidth = 100
End With
Next
End Sub