Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-07-2018, 03:02 AM
shu shu is offline run through tables and format these Windows 10 run through tables and format these Office 2016
Novice
run through tables and format these
 
Join Date: Jun 2018
Posts: 6
shu is on a distinguished road
Unhappy run through tables and format these

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
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
run through tables and format these 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
run through tables and format these Format of the Tables protocoder Word VBA 2 06-28-2011 02:51 AM
run through tables and format these 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

Other Forums: Access Forums

All times are GMT -7. The time now is 09:48 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft