Hello again,
I’ve hit yet another wall.
When using the forms menu to insert a check box into a Microsoft word document, it automatically bookmarks it. I can access the bookmark just fine, but can’t set the box to be checked.
Here is the complete AppleScript Word Dictionary on the subject…
check box‚n, pl check boxes [inh. base object] : Represents a single check box form field.
properties
auto size (boolean) : True sizes the check box according to the font size of the surrounding text. False sizes the check box according to the size property.
check box default (boolean) : Returns or sets the default check box value. True if the default value is checked.
check box value (boolean) : Returns or sets if the check box is selected. True if the check box is selected.
checkbox size (real) : Returns or sets the size of the specified check box in points.
valid (boolean, r/o) : Returns if the check box object is valid.
properties inherited from base object
class (type, r/o) : The class of the object
properties (record) : All of the object’s properties
I created a template names “test” with two check boxes and saved it in the default templates folder. I’m trying to figure how to select the first one and check it.
tell application "Microsoft Word"
tell application "Finder"
set homdir to (get (path to home folder from user domain) as string)
end tell
tell application "Microsoft Word"
activate
set targdoc to homdir & "Library:Application Support:Microsoft:Office:User Templates:My Templates:test.dot"
open file targdoc
end tell
set selFind to find object of selection
tell application "Microsoft Word"
activate
tell check box of bookmark "Check1" of active document
set check box default of selection to true
end tell
end tell
end tell
I get the following error…
Microsoft Word got an error: Can’t set check box default of selection of check box of bookmark “Check1” of active document to true.
If anyone has any ideas on how to properly send this command, I would greatly appreciate the help. I’ve tried several variations and can’t quite seem to get it.
Thanks,
Jim