Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-06-2013, 12:23 PM
Marrick13 Marrick13 is offline True Title Case for First Row of All Tables Windows XP True Title Case for First Row of All Tables Office 2010 32bit
Competent Performer
True Title Case for First Row of All Tables
 
Join Date: Jun 2006
Posts: 102
Marrick13 will become famous soon enough
Default True Title Case for First Row of All Tables

I have a macro I found online that sets “true title case” for any text that’s selected (it places articles such as “a”, “an”, “the”, etc. in lower case unless they are at the beginning of the text as an alternative to Word’s case-changing function). It works very well when the text whose case is to be changed to title case is selected.



I am trying to get this to work for the first row text of all tables in a document, but not having success. The “FormatAllTables” macro is my attempt to achieve this, and it selects the first row of each table, then calls “TrueTitleCase” to handle the case work. I know it’s not good practice to use the selection method, but I’ve other approaches, such as trying to capture just the text instead of the whole row, and been unable to make it work. My early attempts did change the case of the first row of each table, but whenever the first word was one that is in the TrueTitleCase array, it was changed to lower case. I believe this is because the “.MoveEnd Unit:=wdCharacter, Count:=-Len(sText) + 1” line works only when the text is manually selected (so that only the text is highlighted instead of the whole row), but I can’t get the macro to select only the text as it loops through the first row of each table, and I haven’t come up with an alternative to selecting the row that works.

The current version shown here handles the first row properly, but also changes the case of the other rows in the table for words that appear in the array. In other words, the case-changing code is not restricted to only the first row.

Any ideas on how to make this work?

Code is attached.
Attached Files
File Type: docx True Title Case for First Row of All Tables.docx (14.6 KB, 16 views)
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
True Title Case for First Row of All Tables Task Indicator - All predecessors complete true/false, y/n jdove78 Project 2 10-10-2012 05:53 PM
IF formula returns TRUE instead of evaluating COUNTIF ColinC Excel 4 12-28-2011 08:21 AM
Another Case of Automatic/Zombie Formatting of Tables MKummerfeldt Word Tables 0 10-31-2011 10:40 AM
True Title Case for First Row of All Tables Macro not staying true oluc Word VBA 4 11-21-2010 08:10 AM
True Title Case for First Row of All Tables From all UPPER CASE to Proper Case davers Word 1 04-30-2009 12:41 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:31 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft