View Single Post
 
Old 09-18-2015, 07:30 PM
Marrick13 Marrick13 is offline Windows XP Office 2010 32bit
Competent Performer
 
Join Date: Jun 2006
Posts: 102
Marrick13 will become famous soon enough
Default Macro that formats (true title) case by Heading style

I have a macro I adapted from an online source that applies "true title" case to all text with a "Heading 1" style. It works wonderfully provided that Heading 1 text is not the last text in the document. The code is in test document attached - if you run the code, you'll see that it goes into an infinite loop. But if you add text after the Heading-styled text, it runs properly (although I just noticed that it produces a "code execution" error on the end select line after it finishes). The more puzzling issue is why it goes into the infinite loop if Heading 1 text is the last text. I tried a few "Loop Untils" but they didn't stop the endless looping. The wend has something to do with this but I can't figure it out. Can someone help?
Attached Files
File Type: docm Apply_True_Title_Case_by_Style TEST.docm (22.6 KB, 27 views)
Reply With Quote