Link to home
Start Free TrialLog in
Avatar of Frank Helk
Frank HelkFlag for Germany

asked on

Word 2010 macro: Set a checkbox to "checked" ?

I presume it's simple, but I'm mentally stuck o that one:

This piece of macro code in MS Word 2010 should find the first checkbox in the current document (it does) and just set it to checked (that fails):

   
For Each f In ActiveDocument.Fields
    
        If f.Type = wdFieldFormCheckBox Then
            f.Result = True
            Exit For
        End If
    
Next f

Open in new window


The line f.Result = True fails with "Incompatible types". What's wrong, or, to be precise:

How can I set the checkbox to "checked" ?

(The object f contains not property Value ....)
ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Frank Helk

ASKER

Resolved it on my own in the meantime (sorry), but you've hit the spot.