If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Word 2003 Table AutoFormat vs Macro vs VBA
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. |
#2
|
|||
|
|||
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. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Continuous breaks convert to next page breaks | Jennifer Hunt | General Discussion | 2 | December 30th, 2004 05:45 PM |
How to change merge forms from Word Perfect to Microsoft Word | Charles Kenyon | General Discussion | 1 | December 30th, 2004 03:35 PM |
Manual line break spaces on TOC or Table of tables | Eric | Page Layout | 9 | October 29th, 2004 04:42 PM |
Merge to Fax with SBS/Exchange? | Tom | Mailmerge | 3 | May 18th, 2004 11:22 PM |
Can't copy Word 2003 table into Excel 2003 worksheet | JerryD | Setting up and Configuration | 0 | April 14th, 2004 11:21 PM |