Hello, Paul,
I haven't posted in a while not for lack of needing help but for trying to go it alone whenever I was trying to solve a coding problem. When I spend too much time without success, then I ask for help!
Thank you for your version, however, I get a runtime error 5941 (requested member of the collection does not exist) on:
"If Len(.Text) > 2 And .Characters.Last = .Cells(1).Range.Characters.Last Then .End = .End - 1"
I also noticed that with my original code, if any table had a first row that was blank, the code would apply the true title formatting to the words in its array to the text in the NEXT row of the same table. I was going to look into how to make sure it formats only the first row and ignores all tables with an empty first row when I got your response. I don't want it to do anything to any row but the first. Does your code handle this issue better than mine?
Are you testing the code in a Word document that has at least one table with two rows? The only way the error does not occur is if the document has no tables, and that is because if there are no tables, the FormatAllTables2 module won't call the TrueTitleCase module.
|