?
Solved

Macro to AutoFit to Window all tables in a document

Posted on 2007-11-15
3
Medium Priority
?
5,968 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 2000 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

What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

752 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