Syntax to get value MS Word optionbutton

L

Lisab

what is the syntax for reading the value of MS Word option buttons/radio
buttons into MS Access.

I have a form whose data is read into a MS Access table. I edited the form
to change some of the check boxes to option buttons in the sections of the
form where the user should only select one option.

Now, I know I have to update my code. The following code work in reading
the values of the form fields (checkboxes included) into the access table.
--------------------------
For Each FField In WordApp.ActiveDocument.FormFields
strField = FField.Name
rsParse(strField) = "" & FField.Result & ""
Next
---------------------------
How would I edit the following code to read the value of the option
buttons/radio buttons from the word document into my access table.

For Each OButton In WordApp.ActiveDocument.OptionButton
strField = OButton.Name
rsParse(strField) = "" & OButton.Value & ""
Next
 
L

Lisab

This was not easy to figure out but I did it. Here is the answer

Dim OButton as Word.InLineShape

For Each OButton In WordApp.ActiveDocument.InlineShapes
If OButton.Type = "OptionButton" Then
strField = OButton.OLEFormat.Object.Name
msgString = OButton.OLEFormat.Object.Value
End If
Next

(InLineShapes!!!!!! really!! not OBJECT or CONTROL but InLineShape!!!!!!!!!)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top