Word

G

Gerald Ray

I have written a document in Word 2K3 and it has some VB code in it.

However when someone in Word XP opens it they code does not work.

Any ideas?
 
J

Jean-Guy Marcil

Gerald Ray was telling us:
Gerald Ray nous racontait que :
I have written a document in Word 2K3 and it has some VB code in it.

However when someone in Word XP opens it they code does not work.

Any ideas?

No.

Security settings?

Other than that, without seeing the code, and since I did not pass my
Crystal Ball class last semester ;-), it is hard to answer...
Can you post the relevant code?

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
G

Gerald Ray

This is a sample of the code

Private Sub CheckBox2_Click()
If (CheckBox2.Value = True) Then
CheckBox3.Value = True
Else
CheckBox3.Value = False
End If
End Sub

All I do is if you click the check box here it will mark a cooresponding
checkbox later on in the document.
 
J

Jean-Guy Marcil

Gerald Ray was telling us:
Gerald Ray nous racontait que :
This is a sample of the code

Private Sub CheckBox2_Click()
If (CheckBox2.Value = True) Then
CheckBox3.Value = True
Else
CheckBox3.Value = False
End If
End Sub

And how does it fail?
Any error messages? What are they?

If you debug, which line fails?

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
G

Gerald Ray

There are no error messages, the code simply does not appear to execute. In
Word XP but it does in Word 2K3.
 
J

Jean-Guy Marcil

Gerald Ray was telling us:
Gerald Ray nous racontait que :
There are no error messages, the code simply does not appear to
execute. In Word XP but it does in Word 2K3.
I remember hearing about cases where the ActiveX control changed names when
used across versions in XP.

In design mode, right click on a checkbox control and choose "Code" and see
what names is given to the sub you get to. Is it still CheckBox2? It is
often more reliable to give a name to the control and not let Word defaults
to a standard names for ActiveX controls.

Or, put a Stop command at the top of the code to see if the code gets
executed at all or not.

Personally, I avoid them like the pest!
See what Cindy Meister (Word MVP) has to say about ActiveX controls:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnword2k2/html/odc_activeX.asp

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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