5941 error on formfield code

R

RW

I have a macro set for the 'Exit' of a checkbox. In the macro I have the
following:

If ActiveDocument.Formfields("Check1").Checkbox.Value = True Then

This line gives me an error 5941
'The requested member of the collection does not exist.'

The checkbox is called "Check1".

I even tried Msgbox(ActiveDocument.Formfields("Check1").Checkbox.Value) in
the Immediate Window and get the same results. Do I need a Reference
installed or something?
 
H

Helmut Weber

Hi, try

Msgbox ActiveDocument.Formfields("Check1").result

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
R

RW

Thanks for the response. I found the problem. I had copied some text to Word
and modified it there. The font in Word was different than in the vb editor.
Therefore, the new quotes ("") that I added in Word did not translate to ""
in the vb editor. When I deleted them in the editor and added them back,
everything works. It sure seems that vb editor should be able to interpret ""
regardless of the font.
 

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