Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 09-10-2012, 10:53 PM
macropod's Avatar
macropod macropod is offline Formatting all tables Windows 7 64bit Formatting all tables Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,512
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi knightmetal,

Your macro doesn't actually apply the autofit attrinbute. Rather, it sets a preferred width which will remain fixed regardless of changes to margins etc.

A true autofit macro is more like:
Code:
Sub Autofit()
Application.ScreenUpdating = False
Dim Tbl As Table
For Each Tbl In ActiveDocument.Tables
  Tbl.AutoFitBehavior (wdAutoFitWindow)
  Tbl.AllowAutoFit = True
Next
Application.ScreenUpdating = True
Application.ScreenRefresh
MsgBox "Done", vbOKOnly
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Formatting all tables Macro for selecting pages and formatting of tables ubns Word VBA 25 08-15-2012 11:48 PM
Formatting all tables Formatting multiple tables and columns efficiently? table_column Word Tables 1 07-02-2012 05:55 PM
Another Case of Automatic/Zombie Formatting of Tables MKummerfeldt Word Tables 0 10-31-2011 10:40 AM
Formatting all tables Copy table cell formatting across multiple cells / tables pakistanray Word Tables 2 10-31-2011 08:07 AM
Whacked formatting in tables (2007) Roscoe Word Tables 6 06-11-2010 02:48 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:55 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