View Single Post
 
Old 04-28-2017, 07:33 AM
ilcaa72 ilcaa72 is offline Windows 7 64bit Office 2013
Novice
 
Join Date: Jan 2014
Posts: 27
ilcaa72 is on a distinguished road
Default Hold Previous Selecton Sentence variables

hi, I am trying to create a easier way for me to read my Word docs, i have posted before on getting 1 line per sentence which is working, i also figured the way to increase the font size and color of the text for each sentence that my cursor is at, helps in my readings. But once i move up or down to next sentence, the text stays the increased size and color.

what is a method I can revert the previous sentence to its original size, color, font when I move away from it?

The document has different font sizes for Chapter Headings, Section Heading, Sub-Section headings, and Text which i want to maintain, so changing all text as 1 isn't an option. i know I can store the values of Font.Size, Color, Name into variables but how would i apply it to the previously selected sentence? thanks even if you can point me in a direction to explore some options...

the code runs as a WindowsSelectionChange()

Code:
Private Sub msWordApp_WindowSelectionChange(ByVal oSel As Selection)
    Dim doc As Document
    Dim paras As Paragraphs
    Dim para As Paragraph
    Dim sents As Sentences
    Dim sent As Range

    Set doc = ActiveDocument
    Set paras = doc.Paragraphs

    With Selection
        selSize = .Font.Size
        selColor = .Font.Color
        selName = .Font.Name

        .Sentences(1).Select
        .Font.Size = "20"
        .Font.ColorIndex = wdBlue

    End With 
end Sub
Reply With Quote