Word VBA: Displaying the Change Case Dialog Box

This Word VBA macro displays the Change Case dialog box.

Macro Example

Sub DisplayChangeCaseDialog()

  Application.Dialogs(wdDialogFormatChangeCase).Show

End Sub

Description

Application

  Application...

The Application property returns the Application object that represents Microsoft Word application.

obj-Word-Global-Application

Application.Dialogs

  Application.Dialogs...

The Application.Dialogs property returns a Dialogs collection object that represents all the built-in dialog boxes in Microsoft Word.

obj-Word-Application-Dialogs

Dialogs(.Item)

  Application.Dialogs(wdDialogFormatChangeCase)

The Dialogs.Item method returns a single dialog box.

obj-Word-Dialogs-Item

The .Item method is a default member of the Dialogs collection object. We can see a little blue marble beside its icon in the Object Browser.

So, we can omit the .Item.
Well, the code:
Dialogs(wdDialogFormatChangeCase) is equal
Dialogs.Item(wdDialogFormatChangeCase)

And the Dialogs.Item(wdDialogFormatChangeCase) returns the Change Case dialog box.

Dialogs(wdDialogFormatChangeCase).Show (Dialog.Show)

  Application.Dialogs(wdDialogFormatChangeCase).Show

Finally, the Dialogs(wdDialogFormatChangeCase).Show (Dialog.Show method) displays the Change Case dialog box.

Sub DisplayChangeCaseDialog()

  Application.Dialogs(wdDialogFormatChangeCase).Show

End Sub

Properties

http://www.relief.jp/itnote/archives/word-vba-show-dialog-format-change-case.php

Apply To

  • Word 2013
  • Word 2010
  • Word 2007