![]() |
|
#1
|
|||
|
|||
|
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
Last edited by macropod; 06-07-2018 at 04:35 PM. Reason: Added code tags |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
VBA code to format a document containing tables
|
rasika99 | Word VBA | 3 | 12-12-2014 04:16 AM |
| [Rich Text Format] - about tables and pictures | cambalinho | Word | 0 | 07-24-2013 01:17 PM |
Format of the Tables
|
protocoder | Word VBA | 2 | 06-28-2011 02:51 AM |
Auto-Format Tables of Contents/Figures
|
judicial85 | Word | 3 | 12-25-2010 02:02 AM |
| Copying format between tables. | daeron | Word Tables | 0 | 06-11-2010 12:09 AM |