|
OTBJustifyClip is a Word macro that solves the problem of not being able to use full justification in a Time Matters Formattable Clipboard (FC). The Time Matters FC allows you to Left, Center, or Right justify a document. For example, the document below is from a FC that has titles that are Centered, Right and Left justified. The paragraph text is also Left justified, but we want that text to be Fully justified, a setting you can't set in a FC. Note that the text we want to be justified is enclosed in what we call Start and End tags, specifically: [FullStart] and [FullEnd]. 
We love the TM FC feature and feel that with rare exceptions, there isn't much you can't do with it, so long as you are ready to roll up your sleeves, be creative, and be ready to use macros to accomplish what you want. Because we advocate the use of a macro to paste the FC into Word in the first place, why not use that same macro to clean the document up as well? The following macro code justifies the text between the tags, but leaves all the other justification as it is: Sub OTBJustifyClip() ' ' OTBJustifyClip ' Copyright 2009 - OTB Consulting ' Written by Thomas L. Rowe, Esq. ' ' Locate the text that is found between two Start and End tags. ' Check the entire document. ' When found, apply full justification Selection.Find.ClearFormatting With Selection.Find .Text = "\[FullStart\]*\[FullEnd\]" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchAllWordForms = False .MatchSoundsLike = False .MatchWildcards = True End With While Selection.Find.Execute Selection.ParagraphFormat.Alignment = wdAlignParagraphJustify Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting Wend ' Once you have justified the text, need to get rid of the tags With Selection.Find .Text = "\[FullStart\]" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchAllWordForms = False .MatchSoundsLike = False .MatchWildcards = True End With Selection.Find.Execute Replace:=wdReplaceAll With Selection.Find .Text = "\[FullEnd\]" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchAllWordForms = False .MatchSoundsLike = False .MatchWildcards = True End With Selection.Find.Execute Replace:=wdReplaceAll End Sub Here is the document after the macro has been run ... note that the paragraph text has been fully justified, but the titles retain their justification settings: 
We recommend that the macros be run from a toolbar, but that is a lesson for another day. Give this a try and you will have overcome one more FC limitation.
|