E
Edward Mendelson
Hello,
A user tells me that he gets a type mismatch error at these lines in some
code that seems to work for other other users. The code is:
Dim aVal as Long
aVal = Application.Version
Long and Integer work here, but I've seen other code that seems to treat
Application.Version as a string and uses
val(Application.Version)
Can anyone tell me what I *should* be using? I want to test for the
following conditions:
Word 97 (version 8)
Word 2000 and below (<= 9)
Word 2002 and above (>= 10)
Word 2002 (10)
Word 2003 (11)
In my copy of Word 2002 (SP3), if I enter ? Application.Version in the
Immediate window, it returns 10.0. But if I run this code:
Dim aVer As String
aVer = Val(Application.Version)
msgBox (aVer)
Debug.Print aVer
or this code:
Dim aVer As Single
aVer = Application.Version
msgBox (aVer)
Debug.Print aVer
both return 10 (no decimal).
Many thanks for any advice on this one.
Edward Mendelson
A user tells me that he gets a type mismatch error at these lines in some
code that seems to work for other other users. The code is:
Dim aVal as Long
aVal = Application.Version
Long and Integer work here, but I've seen other code that seems to treat
Application.Version as a string and uses
val(Application.Version)
Can anyone tell me what I *should* be using? I want to test for the
following conditions:
Word 97 (version 8)
Word 2000 and below (<= 9)
Word 2002 and above (>= 10)
Word 2002 (10)
Word 2003 (11)
In my copy of Word 2002 (SP3), if I enter ? Application.Version in the
Immediate window, it returns 10.0. But if I run this code:
Dim aVer As String
aVer = Val(Application.Version)
msgBox (aVer)
Debug.Print aVer
or this code:
Dim aVer As Single
aVer = Application.Version
msgBox (aVer)
Debug.Print aVer
both return 10 (no decimal).
Many thanks for any advice on this one.
Edward Mendelson