Macro to AutoFit to Window all tables in a document

Hi Macro experts.
Can you help me to AutoFit to Window all the tables in a single word document.

If I use the select all text option then try to use the AutoFit to Window, I can't as the option is not available for some reason.  

I hope a macro could acheive this. Please help with code.  
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

GrahamSkanConnect With a Mentor RetiredCommented:
No problem with a macro

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

Phesant123Author Commented:
Cheers Graham i'll try this on Monday and confirm solution if macro is succesful.
Phesant123Author Commented:
Great help,fast and to the point.
All Courses

From novice to tech pro — start learning today.