Microsoft Word Suite
255
Example
This example assigns the OPTION+F4 key combination to the Arial font and then displays the
number of items in the key bindings list. The example then clears the key combinations (returns it
to its default setting) and redisplays the number of items in the key bindings list.
set customization context to normal template
make new key binding with properties ¬
{key code:(build key code key1 key alt key2 f4_key), ¬
key category:key category font, command:"Arial"}
display dialog (get (count of key bindings) as string) & " keys in the key ¬
binding
list"
clear (find key key code (build key code key1 key alt key2 f4_key))
display dialog (get (count of key bindings) as string) & " keys in the key ¬
binding
list"
This example assigns the CTRL+SHIFT+V key combination to the macro named "Macro1" in the
active document. The example uses the find key command to return a key binding object so that
Word can retrieve and display the command name.
set customization context to active document
make new key binding with properties ¬
{key code:(build key code key1 control_key key2 shift_key ¬
key3 v_key), key category:key category macro, command:"Macro1"}
display dialog (get command of (find key key code (build key code key1 ¬
control_key key2 shift_key key3 v_key)))
This example determines whether the CTRL+SHIFT+A key combination is part of the key bindings
list.
set customization context to normal template
set myKey to find key key code (build key code key1 control_key key2 ¬
shift_key key3 a_key)
if command of myKey is "" then display dialog "Key is not in the key ¬
bindings
list"
Command: find record
Searches the contents of the specified mail merge data source for text in a particular field. Returns
True if the search text is found.
Note Corresponds to the Find Record button on the Data Merge Manager.
Syntax
find record data merge data source Required. An expression that returns a data merge data
source object.
find text Required. The text to be looked for.
field name Required. The name of the field to be searched.