View Single Post
  #2   Report Post  
Fred Holmes
 
Posts: n/a
Default

For the reasons you enumerated, I don't think any one approach will
work. I generally like the vba approach, but it fails (I don't find a
command) to uncheck certain check-boxes. Here's some code that I use
to set the column widths to specific lengths in inches, because I
don't like the Word 2003 Table, Properties interface. In the code,
some long lines have wrapped in this message content.

Sub A_Table_Column_Width_Set()
' Macro to set the width of the current/selected column
Dim w As Variant
If Selection.Information(wdWithInTable) = True Then
w = InputBox(Prompt:="Enter the desired Column Width in inches:",
Title:="Column Width")
Selection.Columns(1).Width = InchesToPoints(w)
Else
Dim Result01
Result01 = MsgBox(Prompt:="The insertion point must be in a
Word Table for this to work.", Title:="Set Column Width in Word
Table.")
End If
End Sub
Sub A_Table_Column_Width_Get()
' Macro to get/report the column width of the current column
If Selection.Information(wdWithInTable) = True Then
MsgBox "The Width of the Cell is " &
PointsToInches(Selection.Cells(1).Width) & " inches."
End If
End Sub
Sub A_Table_Center_Across_Page()
If Selection.Information(wdWithInTable) = True Then
Selection.Tables(1).Rows.Alignment = wdAlignRowCenter
Selection.Tables(1).Rows.LeftIndent = InchesToPoints(0)
Else
Dim Result01
Result01 = MsgBox(Prompt:="The insertion point must be in a
Word Table for this to work.", Title:="Center Table Across Page.")
End If
End Sub

On Wed, 27 Oct 2004 13:33:10 -0700, Kind writer/user/programmer

wrote:

Ultimate goal is to create a predictable ironclad table format.

What's diff tween using a macro (and some VBA fortifications) vs Table
Autoformat (with a customized table style). Each approach has problems:

I defined table cell styles and used a macro, to some degree of
success...however, some settings (heading rows repeat) are toggles; other
items don't "show up" as a VB command/method/object (i.e., format to fit
content, then turn that off so table doesn't automatically resize).

I also customized one of the autoformat table styles to look more or less
like I want.

However, the Autoformat doesn't apply "styles" to cells, so when users use
(for example) Normal, or Heading 1 (autonumbered), the paragraph formatting
in the cells is wrong. Also the checkboxes for first row different (table
head centered tyle) and first column different(table cell bold) style), don't
seem to stick.

And, the table layout is...well, resizing table widths is a new challenge in
Word 2003. The Alt key helps (when resizing), but most often, mousing over a
column divider (vertical line in a table), the cursor blinks from 4-arrow to
white diagonal, and its a dickens to get the 2-
vertical-lines-with-outward-facing-arrows cursor to display at all.

Please advise.