Consulting

Results 1 to 6 of 6

Thread: Selection refusing to 'unselect' the superscript button (ctrl shift plus-sign)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Selection refusing to 'unselect' the superscript button (ctrl shift plus-sign)

    Sub cs_citation_01()
    '   cs_citation_01 Macro
        
        Dim fontSize As Integer
        Dim fontName As String
        
        Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
        
        fontSize = Selection.Font.Size
        fontName = Selection.Font.Name
        
        Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
        
    
        SendKeys "{RIGHT}"
    
        With Selection
            .Font.Size = 14
            .Font.Superscript = True
            .TypeText Text:="[" & websiteName & "]"
            selectTextToFormat (websiteName)
            .Hyperlinks.Add Anchor:=Selection.Range, TextToDisplay:=Selection.Range.Text, Address:=hyperLink     'TextToDisplay:=Selection.Text
        End With
    
        Selection.Font.Superscript = False
    
        'Superscript button still selected on MS Wo
        
    '   Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
    '    SendKeys "{RIGHT}"
    '    SendKeys " "
        
    '    Selection.Font.Size = fontSize
    '    Selection.Font.Name = fontName
        
        'MsgBox ("Ln53")
    End Sub
    I need the program to deselect, the SuperScript Notation, and to revert back to the font size of the character, preceding the bracket, [], tags.


    Edit: The following is closest to what I'm trying to do, due to Extend:=wdMove instead of Extend:=wdExtend. But when used on the last line, the superscript notation is still 'enabled' in the GUI.

        Selection.Font.Superscript = False
        
        Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdMove
    Last edited by donedown; 02-14-2020 at 03:38 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •