Avatar of al4629740
al4629740
Flag for United States of America asked on

How to select a checkbox in Microsoft Word from VB6

I am using VB6 to access a Microsoft Word template.  What I am perplexed on what to do is how to select a checkbox field as you can see from the attached image.  Currently Quarter 2 is selected.  How can I select Quarter 3.  I can bookmark the field, but I don't know the syntax for selection and checking the field.  Any help is appreciated.  


Here is some example code I am currently using in the document if that helps.

            objMSWord.ActiveDocument.Bookmarks(ObjectiveNumber).Select
            objMSWord.Selection.TypeText "ACTIVITY: " & rec!ActivityName & " - " & rec!ActivityType & "    " & rec!ActivityOther & vbCrLf
            objMSWord.Selection.TypeText "Identified Need: " & rec!Need & "    " & rec!NeedOther & vbCrLf
            objMSWord.Selection.TypeText "Objective Addressed: " & rec!Objectives & vbCrLf
            objMSWord.Selection.TypeText "Stated Strategy: " & rec!Strategy & vbCrLf
            objMSWord.Selection.TypeText "Outcome: " & rec!Outcome & vbCrLf
            objMSWord.Selection.TypeText "Narrative Summary: " & rec!Narrative & vbCrLf
            objMSWord.Selection.TypeText "-----------------------------" & vbCrLf & vbCrLf

Open in new window

example.jpg
Visual Basic Classic

Avatar of undefined
Last Comment
GrahamSkan

8/22/2022 - Mon
GrahamSkan

Hi,
What sort of checkbox?  Is it a Form Field, an Active X or a Content Control? If not in developer mode, all three types of checkbox look very similar.
The code seems to be adding text at a bookmark, so that doesn't help very much.
al4629740

ASKER
I think form fields
GrahamSkan

To use the document, do you have to protect it for 'Filling in forms'?
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
ASKER CERTIFIED SOLUTION
GrahamSkan

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.