Author-it: Autofit tables in Word output

October 6, 2008

This macro allows ALL tables to resize automatically according to the width of the available space in Word. Very handy if you decide to change your Author-it Media Object’s left margin width at a later date… But be warned—ALL tables will resize to fit the width of the available space, including those you’ve set to be wide or quite narrow. So use it with caution and try it on a test document first.

Add it as an AfterPublish macro.

 Sub ResizeTables()
   Dim myObject As Table
   For Each myObject In ActiveDocument.Tables
   myObject.AutoFitBehavior (wdAutoFitWindow)
End Sub


  1. Is it possible to do something similar with images? All my images, which look fine embedded directly into a Word document, and also look fine in the Author-it Topic screen, are shrunk to a small size in the published Word document. I think it’s something to do with image’s pixel dimensions being resized according to screen (96 dpi)and print (300 dpi) though why that should be OK in Word direct but not via Author-it I have no idea.

  2. Hi Phil

    This issue has come up a few time on the Author-it Users Group, but I can’t recall the cause or the solution. It only happens to some people some time. Not everyone all the time.

    I’ve seen it happen when I’ve captured a PNG graphic using one program (SnagIt) then opened it in another (PaintShop Pro), manipulated it and saved it from there. I use the default settings for both applications. If I use the PNG from SnagIt it works fine, or if I use a PNG I’ve captured or created in PaintShop Pro, but not if I use both apps on the one graphic. At least I *think* that’s what happened the few times I’ve seen this. The other time it’s gone wonky for me is if someone else sent me the graphic—invariably they’ve captured it in a program like Microsoft Paint.

    Search the Author-it User Group archives (I find Hamish Blunck’s search better than Yahoo’s: http://hamishblunck.com/authorit/index.php

  3. […] Macro to autofit all tables to the Window (page) size […]

  4. Thank you autofit to window worked

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: