I received error sub or function not defined in Word 2003 - any ideas what I should alter please?
'does not work
Sub ResizeAllTables()
Dim oTbl As Table
For Each oTbl In ActiveDocument.Tables
oTbl.AutoFitBehavior wdAutoFitFixed
With ActiveDocument.PageSetup
oTbl.PreferredWidth = .PageWidth - .LeftMargin - .RightMargin
End With
Next oTbl
End Sub
Bob was telling us:
Bob nous racontait que :
> I received error sub or function not defined in Word 2003 - any ideas
> what I should alter please?
[quoted text clipped - 10 lines]
> Next oTbl
> End Sub
I tested your code as is (except that I removed the "oTbl" in "Next oTbl" as
it is not necessary) and it worked fine. I am also using Word 2003.
Do you have another sub named oTbl or a another function called
ResizeAllTables elsewhere in your project?

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Bob - 20 Oct 2007 10:27 GMT
Thanks Jean-Guy,,
> Bob was telling us:
> Bob nous racontait que :
[quoted text clipped - 19 lines]
> Do you have another sub named oTbl or a another function called
> ResizeAllTables elsewhere in your project?
Jean-Guy Marcil - 22 Oct 2007 16:01 GMT
Bob was telling us:
Bob nous racontait que :
> Thanks Jean-Guy,,
You're welcome... but I have no clue what you are thanking me for!

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org