1
votes

I'm using some VBA to manipulate the Office autocorrect list in real time. For the most part I have the modification working by calling the AutoCorrect methods in Word. The problem is that only Word seems to know that a change has been made. Is there a way to trigger the other Office apps (Outlook, PowerPoint) to refresh autocorrect so that they are working from the updated list? It seems like there is something happening when you manually navigate to the AutoCorrect Options screen that informs the apps that a change occurred so I'm hoping to automate it (without presenting any dialog). Any insight is much appreciated.

Thanks

1

1 Answers

0
votes

You want to implement functionality in Outlook. However, there is no autocorrect object in outlook.

In the Outlook Object Model, assuming a message is being displayed in an inspector, Application.ActiveInspector.WordEditor.Application will give you the Word Application object which exposes the AutoCorrect property.

You can refer to the following code to get the document object.

Dim oDoc As Word.Document   ' Or add a reference to the Microsoft Word Object Library for IntelliSense
    Dim oMail As Outlook.MailItem

    If TypeOf Application.ActiveInspector.CurrentItem Is Outlook.MailItem Then
        Set oMail = Application.ActiveInspector.CurrentItem
    Else
        Exit Sub
    End If

    Set oDoc = oMail.GetInspector.WordEditor