Welcome toWord.Tips.Net
Ask a Word Question
Make a Comment
Learn Access Now
Free Printable Forms
Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Legal Tips
Money Tips
Organizing Tips
Pest Tips
Pet Tips
Wedding Tips
Word2007 Tips
WordTips
Collapsing and Expanding Subdocuments
Many people who are familiar with WordPerfect later find the need to learn how to use Word. Sometimes the transition is not entirely smooth, in large part because tasks aren't accomplished the same way in Word as they are in WordPerfect.
A case in point is adjusting the width of table columns by using the keyboard. WordPerfect, which has always been a "keyboard oriented" program, makes the adjustments easy: just press > or < to widen or narrow the column. Word, on the other hand, has always been more mouse oriented and has no equivalent keyboard command for this task.
There are workarounds; for instance, you can use the keyboard to type Alt+A, R, U, and then press Tab a couple of times to get to the column width field. The problem with this, of course, is that it is not anywhere near easy (or intuitive).
If you don't mind using the mouse, you can hold down the Alt key as you drag a column border. The Ruler changes to show the precise width of your columns as you move the border. Very cool, but still a pain for those who would rather just use the keyboard. (It is also not terribly helpful for those who may not have very good mouse resolution, or who cannot move the mouse very small distances.)
Perhaps the best solution is to make your own emulation of the WordPerfect capability. The following macro can do just that:
Sub StretchColumn()
Dim CurrentSize As Integer
Dim NextSize As Integer
Dim CurCol As Integer
'Get the current width (in points)
CurCol = Selection.Cells(1).ColumnIndex
CurrentSize = Selection.Tables(1).Columns(CurCol).Width
'Increase the current width by one point
NextSize = CurrentSize + 1
Selection.Columns(1).SetWidth _
ColumnWidth:=NextSize, _
Rulerstyle:=wdAdjustNone
End Sub
If you assign this macro to a shortcut key (as described in other issues of WordTips), then you can increase the width of the current table column by one point (1/72 of an inch) each time you press the shortcut key. You can make a simple change to the macro to create a version that decreases the column width, as well:
Sub ShrinkColumn()
Dim CurrentSize As Integer
Dim NextSize As Integer
Dim CurCol As Integer
'Get the current width (in points)
CurCol = Selection.Cells(1).ColumnIndex
CurrentSize = Selection.Tables(1).Columns(CurCol).Width
'Decrease the current width by one point
NextSize = CurrentSize - 1
Selection.Columns(1).SetWidth _
ColumnWidth:=NextSize, _
Rulerstyle:=wdAdjustNone
End Sub
Tip #3912 applies to Microsoft Word versions: 97 2000 2002 2003 2007
Take Control! Master the real power behind Word! Successfully master the secrets of powerful formatting and create documents that stand out from the rest. Best of all, you can create documents that are easy to maintain and quick to change.