Outlook 2013 - VBA - reply in line

1

0

I have written a small script to automatically select the first autocorrect option. It works when, in 2013, I write a new email or "pop out" an email. However - it does not work when I reply "in line" - e.g. per the right window in the image below.

In VBA - how does one find/select text in a new email when once is in the "work in line" mode?

enter image description here

Below is my current code

Sub Spellcheckoutlook()

Dim oSE As Word.Range
Dim oSC
With ActiveInspector
    If .IsWordMail And .EditorType = olEditorWord Then
        For Each oSE In .WordEditor.Range.SpellingErrors
            Set oSC = oSE.GetSpellingSuggestions
            If oSC.Count > 0 Then
            oSE.Text = oSC(1)
            End If
        Next oSE
    End If
End With

End Sub

Wouter

Posted 2015-07-17T07:48:56.810

Reputation: 121

Answers

2

You code works with Outlook Inspector (a separate message window). In order to be able to manipulate the right-side preview pane text, you need to use the ActiveExplorer's ActiveInlineResponseWordEditor property like this:

Set Editor = ActiveExplorer.ActiveInlineResponseWordEditor
If Editor Is Nothing And Not ActiveInspector Is Nothing Then
    Set Editor = ActiveInspector.WordEditor
End If
If Not Editor Is Nothing Then
    ' Do your stuff for Editor.Range ...
End If

thims

Posted 2015-07-17T07:48:56.810

Reputation: 8 081