We help IT Professionals succeed at work.

How to select a checkbox in Microsoft Word from VB6

al4629740
al4629740 asked
on
179 Views
Last Modified: 2019-01-28
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
Comment
Watch Question

GrahamSkanRetired
CERTIFIED EXPERT
Top Expert 2012

Commented:
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.

Author

Commented:
I think form fields
GrahamSkanRetired
CERTIFIED EXPERT
Top Expert 2012

Commented:
To use the document, do you have to protect it for 'Filling in forms'?
Retired
CERTIFIED EXPERT
Top Expert 2012
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions