I am looking for a way (or decent introduction) into how to select every table in a Microsoft Word 2013 Document and autofit the contents. Each table is independent of one another and separated by text.
I have established the following code so far:
Sub autofit()
Selection.Tables(1).AutoFitBehavior (wdAutoFitContent)
End Sub
Which works for individual tables and every column in said table, I understand the format of the "for loop", but would like a nudge to how to transform my individual selection to the entire document.
This is my first post so apologies for any conventions I have missed.
Its pretty trivial to loop them all;
Dim t As Table
For Each t In ActiveDocument.Tables
t.AutoFitBehavior wdAutoFitContent
Next
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With