I would like to change the character spacing to the selected text from the paragraph. But my below code change the character spacing for the entire text box. Can anyone help me with this.
For e.g., I just need to increase the character spacing only for the selected text from the entire sentence. Shown in the below picture
ActiveWindow.Selection.ShapeRange.TextFrame2.TextRange.Font.Spacing = 3
Also below code can help me with my purpose. But here the issue is, how can i get the 20 and 45 from the macro.
ActiveWindow.Selection.ShapeRange.TextFrame2.TextRange.Characters(20, 45).Font.Spacing = 3
Your code:
ActiveWindow.Selection.ShapeRange.TextFrame2.TextRange.Font.Spacing = 3
refers to the entire text range of the selected shape. Instead, use:
ActiveWindow.Selection.TextRange2.Font.Spacing = 3
This will act only on the selected text.