Microsoft Word Suite
317
Example
This example protects the active document for forms without resetting the contents of the form
fields.
if protection type of active document is no document protection then
protect active document protection type allow only form fields ¬
with no reset
end if
This example protects Monthly Report.doc so that only comments can be added to it. The password
"free" is required to unprotect the document.
set myDoc to document "Monthly Report.doc"
protect myDoc protection type allow only comments password "free"
Command: rebind
Changes the command assigned to the specified key binding.
Syntax
rebind key binding Required. An expression that returns a key binding object.
key category enumeration Required. The key category of the specified key binding. Can be one
of following:
key category auto text
key category command
key category disable
key category font
key category macro
key category nil
key category prefix
key category style
key category symbol
command Unicode text Required. The name of the specified command.
[command parameter Unicode text] Optional. Additional text, if any, required for the command
specified by command.
Example
This example reassigns the CTRL+SHIFT+S key binding to the FileSaveAs command.
set customization context to normal template
set myKey to find key key code (build key code key1 control_key ¬
key2 shift_key key3 s_key)
rebind myKey key category key category command command "FileSaveAs"
This example rebinds all keys assigned to the macro named "Macro1" to the macro named
"ReportMacro."
set customization context to attached template of active document
repeat with myKey in (get keys bound to key category key category macro ¬
command
"Macro1")
rebind myKey key category key category macro command "ReportMacro"
end repeat