Hello,
I would like to have a code for automatic autofit table when pasting from excel to message body.

I have tried this one but fot an error for the 2nd line saying: "Object Required"

Private Sub AutoFitContentsForAllTables()
If ActiveDocument.Tables.Count > 0 Then
Dim objTable As Object

Application.Browser.Target = wdBrowseTable
For Each objTable In ActiveDocument.Tables
objTable.AutoFitBehavior (wdAutoFitContent)
Next
End If
End Sub



Thank for your help.