There are two problems here, both caused by the fact that you have to be
able to compile the code in both versions - there is no compiler variable
which distinguishes the word version.
1) the Word 2000 compiler doesn't like RevisionsMode as a property
To get the property name past the compiler you have to disguise it; you can
do this by passing it as a string to the VBA CallByName method. Word 2000
will then compile OK, but just not run the statement because the version
condition will fail.
2) the Word 2000 compiler won't recognise the constant, wdInLineRevisions
If you have Option Explicit, you will not be able to use the Word constant
because the compiler will reject it as an undeclared variable. You can
either declare the constant yourself and the Word 2002 compiler will use
your version instead of Word's, or you can just use the constant 1 instead.
Or you could not use Option Explicit but I wouldn't recommend that.
Putting it all together (and ignoring the "With" you posted) you get
Const wdInLineRevisions = 1
If Application.Version >= 10 Then
CallByName ActiveWindow.View, "RevisionsMode", VbLet, wdInLineRevisions
End If
Enjoy,
Tony
> Hi,
>
[quoted text clipped - 18 lines]
>
> Any suggestions on why the 2000 compiler does like that line of code?
hgazdik - 30 Sep 2005 22:44 GMT
Thank you Tony.
That removed the compile error!
Heather