Thread: [Solved] Need a macro adjustment
View Single Post
 
Old 12-09-2021, 07:10 AM
Ulodesk Ulodesk is offline Windows 10 Office 2016
Word 2013 Expert Cert
 
Join Date: Sep 2009
Location: Virginia
Posts: 866
Ulodesk is on a distinguished road
Default

Bikram, thank you very much for your expertise. This does indeed ignore the wrap-around tables, which is great.

I am finding an anomaly in some non-wrap tables, however, and perhaps you can help me understand. It seems that I have once again failed to include every necessary variable in my presentation of the problem, for which I apologize; I am out of my league when it comes to macros.

In the test document I tried on which I tried out your macro, there were some tables that had a width set, and although they indented properly, the width remained as it was.

I started with a fresh copy (made from a template that had the tables in it as samples). The template is standard 8.5x11-inch paper with 1-inch margins, hence the tables had been specified at 6.5 inches wide, left-aligned. The column widths had been dragged in when originally designed, and hence they had specified measurements as well.

In the fresh copy, I changed the document margins to a half-inch, selected one such table, opened properties, and then unchecked the table width box and deleted each column width value. When I ran the macro, the 6.5-inch width remained, and when I opened the table properties dialogue, width box was checked and the value was back in the table width field.

I can only guess that perhaps this is related to the "Automatically fit size to contents" box in Options being unchecked, which is always my preference in the proposal work we do, for various reasons.

I don't know if there is an inherent conflict here or if, perhaps, there is code that could be inserted that would allow the macro to override and allow the width for such tables to be set as otherwise specified by the macro.

Although a majority of our documents work with our templates, we do get outliers like the one that prompted this thread, in which we are obliged to work in the client's document, and which is already more than 150 pages with about 80 non-wrapped tables so far, and the need to indent 0.3 and change the width to 7.2. This macro is potentially an enormous boon in such circumstances, and even I can see how to adjust the indent and width values.

I would be most grateful for any further attention you can give this.
Reply With Quote