Solved

Macro to AutoFit to Window all tables in a document

Posted on 2007-11-15
3
4,620 Views
Last Modified: 2013-11-27
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.  
 
0
Comment
Question by:Phesant123
  • 2
3 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 500 total points
ID: 20294642
No problem with a macro

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


0
 
LVL 1

Author Comment

by:Phesant123
ID: 20304271
Cheers Graham i'll try this on Monday and confirm solution if macro is succesful.
0
 
LVL 1

Author Closing Comment

by:Phesant123
ID: 31409468
Great help,fast and to the point.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Selection object is designed for user interaction. It has a Range property, so it can be used in most places that a Range object can. Recorded macros must use the Selection because they are simply copying what the user is doing. A Range prope…
I would like to show you some basics you can do with Mailings in MS Word. It´s quite handy feature you can use for creating envelopes, labels, personalized letters etc. First question could be what is this feature good for? Mailing can really he…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now