Really Weird Problem Formatting Word Table

W

Will Nelson

Thank you in advance

I have a macro to format a Word table. In particular, I wish to set the width of columns to a particular standard. The code appears as follows

Selection.Tables(1).Columns(1).Selec
Selection.Columns.PreferredWidthType = wdPreferredWidthPoint
Selection.Columns.PreferredWidth = myWidt
Selection.ParagraphFormat.Alignment = wdAlignParagraphCente

The above is repeated for all of the columns in the table by using a different value in the Columns() argument. The value of MyWidth changes from column to column

At the end, there is the following line of code

Selection.Tables(1).AutoFitBehavior (wdAutoFitFixed

Here is the issue. If I single step through this code the table formats perfectly. However, if I run the macro (all at once) none of the column widths "take"

I give up

Thanks

W
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Answered in the vba group to which you also posted it. Please do not
multipost

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top