Set table to default "AutoFit to Window"

Is there a way to set AutoFit to Window as a default for my tables within a template?

 

I know I can change each table one by one.

 

I'm trying to use a table in my header so when I insert a section break my table will automatically "fit" to the page.  I can do it manually but I'm tryig to automate it for authors.

 

Any thoughts?

Answer
Answer

AutoFit to Window should be the default when creating new tables in Word. However, to change the setting for existing tables, you can use the following macro:

Sub SetFitToWin()
Dim t As Table
For Each t In ActiveDocument.Tables
t.AutoFitBehavior wdAutoFitWindow
Next t
End Sub

For assistance with the macro, see http://www.gmayor.com/installing_macro.htm.

Stefan Blom
Microsoft Word MVP
Volunteer Moderator
~~~~
Note that MVPs do not work for Microsoft
MVP program: https://mvp.microsoft.com/
FAQ: https://answers.microsoft.com/en-us/page/faq
~~~~

5 people were helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

 
 

Question Info


Last updated April 15, 2020 Views 3,195 Applies to: