Odd Behaviour when adjusting column width via Word VBA
I followed the VBA sample from the above thread and it works fine on a newly created table from Word.
In my scenario, I am creating a Word document from another application. The 3rd party application creates tables and using a Word template which I supplied, it pastes HTML into the Word document. The application creates a bunch of tables in the Word document and the column widths are different. I want to make them evenly distributed.
When I run the routine noted above, it doesn't work on first try. If I then go to one of the tables and adjust the column width on any random column and then go back and run the macro again, the table resizes the columns. It only seems to work for those tables in the document where I manually resize a column.
Obviously this defeats the purpose of the macro.
Anyone have any ideas why this behaviour is occurring? Does it have something to do with the HTML that is used to create the table when the document is first created?
Appreciate any thoughts and/or corrective actions.
|