Solved: Get MS Word OptionButton value from Excel VBA
Hi all,
I've create a MS Word document which contain an OptionButton, i want to retrieve the value (checked or unchecked) from an Excel macro.
The goal is to collect answers from many filled word documents, and put it into an Excel Spreadsheet.
Many thanks for your help
Get MS Word OptionButton value from Excel VBA
[IMG]file:///C:/DOCUME%7E1/ERIC%7E1.MAL/LOCALS%7E1/Temp/moz-screenshot-1.jpg[/IMG]Hi Kenneth,
It's not a form, i've put the screenshot of toolbar and the composant for which i want to retrieve value from Excel macro ... hope you can see it, it will be a bit complicate to upload it :(
Many thanks for your help
What about ActiveX Controls?
I am facing the same situation with the exception that I have used ActiveX controls in my word document.
The macro you wrote doesn't seem to work for me. It gives the error message "Object variable not set".
What do I need to change in the above code to make it work?
Code for inserting ActiveX optionbutton
In 2007 it looks like this when I add an ActiveX Option button.
[VBA]Sub AddButton()
'
' AddButton Macro
'
'
ActiveDocument.ToggleFormsDesign
Selection.InlineShapes.AddOLEControl ClassType:="Forms.OptionButton.1"
End Sub[/VBA]