Word VBA - Paste a word to Word Autocorrect dialog box

March 13th, 2012 - 08:35 pm ET by Irman Wardhana | Report spam
I need help
Default behavior:
I select a word in a document then open Autocorrect dialog box. The word I select automatically appears in the 'With textbox' and the 'Replace textbox' is empty.

What I need is:
the word automatically appears in the 'Replace textbox' and the 'With textbox' is empty.

Is there a way to do that using Word vba macro, maybe by paste the word to the 'Replace textbox'?

I only manage to open the Autocorrect dialog box, using:

Dialogs(wdDialogToolsAutoCorrect).Show

then I don't know what to do.
email Follow the discussionReplies 2 repliesReplies Make a reply

Replies

#1 Stefan Blom
March 19th, 2012 - 04:12 am ET | Report spam
When you select something in the document before opening the AutoCorrect
dialog box, Word assumes that you want to create a formatted AutoCorrect
entry. As far as I know, there is no way to add formatting to the word or
expression being replaced by AutoCorrect.

However, if you are saying that you want to work with AutoCorrect in code,
don't use the dialog box. Instead, work with the AutoCorrect object
directly. For example, to add an AutoCorrect entry:

Dim r As AutoCorrect
Set r = Application.AutoCorrect

r.Entries.Add "wtbr", "words to be replaced"

Stefan Blom
Microsoft Word MVP





"Irman Wardhana" wrote in message
news:

I need help
Default behavior:
I select a word in a document then open Autocorrect dialog box. The word I
select automatically appears in the 'With textbox' and the 'Replace textbox'
is empty.

What I need is:
the word automatically appears in the 'Replace textbox' and the 'With
textbox' is empty.

Is there a way to do that using Word vba macro, maybe by paste the word to
the 'Replace textbox'?

I only manage to open the Autocorrect dialog box, using:

Dialogs(wdDialogToolsAutoCorrect).Show

then I don't know what to do.

Similar topics