This topic has not yet been rated - Rate this topic

Application.KeyString Method (Word)

Published: July 16, 2012

Returns the key combination string for the specified keys (for example, CTRL+SHIFT+A).

expression .KeyString(KeyCode, KeyCode2)

expression A variable that represents an Application object.

Parameters

Name

Required/Optional

Data Type

Description

KeyCode

Required

Long

A key you specify by using one of the WdKey constants.

KeyCode2

Optional

Variant

A second key you specify by using one of the WdKey constants.

Return Value

String

You can use the BuildKeyCode method to create the KeyCode or KeyCode2 argument.

This example displays the key combination string (CTRL+SHIFT+A) for the following WdKey constants: wdKeyControl, wdKeyShift, and wdKeyA.

CustomizationContext = ActiveDocument.AttachedTemplate 
MsgBox KeyString(KeyCode:=BuildKeyCode(wdKeyControl, _ 
 wdKeyShift, wdKeyA))

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.