What I need this for is formatting for an academic journal. It seems super meticulous, but it's part of formatting conventions for academic journals going to publication. There's a rule that states that, because a reader's attention would be distracted from having certain punctuation at the end of a line, you can never leave that punctuation at the end of a line. (I don't make the rules...I'm also not allowed to break them.) Unfortunately, there aren't a lot of resources for optimizing Word for precise journal formatting rules (probably because literally nobody else on the planet other than academic journals does it...or even notices it.)
This process comes at the very end of editing (no further edits occur) and the word document is then exported to PDF before being sent to a professional printer.
I feel like there has to be some way around having to do this manually. Right now, I have to manually scroll through hundreds of pages, look at the last character of each line, and place a manual line-break before any word that precedes an em-dash or en-dash. It usually takes me about 6 hours for each article that I have to process. Six very long hours.
Just brainstorming, but I wouldn't be able to programmatically just add a soft enter before each word that precedes an em-dash or en-dash because that would impact words that are in the middle of lines, too. Word does have an option to ensure hyphens are non-breaking, so it seems like theoretically, whatever code is running in the background to support that option could also be applied to other characters. Probably. (Or maybe not. Macros are in VBA, but the backend language of Word is probably something like C#, and the code just might not translate over. Or something. I don't know, there's a reason I didn't go into computer science, lol.)
My other ideas are that, because I believe Visual Basic (but not VBA) has a line object, maybe there's a way to do that work in a separate VB application. But then that would probably not keep all the other formatting necessary, like Styles applied to the text.
What do you think?
|