Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Business Applications Business Applications
Search Search
Search for:
Tech Support Guy > > >

Solved: ActiveX Checkbox


(!)

rayd7024's Avatar
rayd7024 rayd7024 is offline
Junior Member with 3 posts.
THREAD STARTER
 
Join Date: Nov 2011
22-Nov-2011, 01:16 PM #1
Solved: ActiveX Checkbox
I inserted an ActiveX checkbox into a Word 2007 document. I accepted the default name of CheckBox1 for the check box. I created a macro to set the checkbox value to false as follows:
Sub SetCheckBox()
ActiveDocument.FormFields.Item("CheckBox1").CheckBox.Value = False
End Sub

When I run the macro, I get the following error:
Run-time error '5941': The requested member of the collection does not exist.

Can anyone shed some light on the problem and possible solution.
Any and help will be greatly appreciated.
Rollin_Again's Avatar
Member with 4,689 posts.
 
Join Date: Sep 2003
Location: Atlanta, GA - Planet Earth
Experience: Advanced
22-Nov-2011, 05:48 PM #2
Try using the .InlineShapes collection instead. Just replace the number 1 with the index number of your actual control.

Code:
ActiveDocument.InlineShapes(1).OLEFormat.Object.Value = False
Rollin

Last edited by Rollin_Again; 22-Nov-2011 at 05:58 PM..
rayd7024's Avatar
rayd7024 rayd7024 is offline
Junior Member with 3 posts.
THREAD STARTER
 
Join Date: Nov 2011
22-Nov-2011, 06:25 PM #3
Eureka!
Thanks!
It works like a charm.
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


Tags
activex control, checkbox, macro, word 2007

(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑