Microsoft Word Suite
227
Example
This example displays the result of a grammar check on the selection.
set pass to check grammar text to check (get content of text object ¬
of
selection)
display dialog "The selection is grammatically correct: " & pass
Command: check spelling
Checks a string for spelling errors. Returns true if the string has no spelling errors.
Syntax
check spelling application/document An expression that returns an application or document
object.
text to check Unicode text Required. The text whose spelling is to be checked.
[custom dictionary dictionary] Optional. Either an expression that returns a dictionary object or
the file name of the custom dictionary.
[ignore uppercase Boolean] Optional. True if capitalization is ignored. If this argument is
omitted, the current value of the ignore uppercase property of the Word options class is used.
[main dictionary dictionary] Optional. Either an expression that returns a dictionary object or
the file name of the main dictionary.
[custom dictionary2custom dictionary10 dictionary] Optional. Either an expression that
returns a dictionary object or the file name of an additional custom dictionary. You can specify
as many as nine additional dictionaries.
Example
This example displays the result of a spelling check on the selection.
set pass to check spelling text to check (get content of text object ¬
of
selection)
display dialog "The selection has no spelling errors: " & pass
Command: clean string
Removes nonprinting characters (character codes 1-29) and special Word characters from the
specified string or changes them to spaces (character code 32), as described in the "Remarks" section.
Returns the result as a string.
Syntax
clean string
item to check Unicode text Required. The source string that you want to clean.