Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I just wanted to say that you guys RULE, a million thank you's to whoever created, and/or manages this site. KEEP UP THE GOOD WORK..."

Geography

Where in the world do Tek-Tips members come from?
BarryG (Programmer)
2 Aug 01 18:38
I'm writing a macro in Word that needs to be able to run in Word 97 and Word 2000. However, when it's run in 2000, I need to add a statement that 97 doesn't require. The problem is that the method I need in 2000 doesn't exist in 97 so when I run it in 97 it gives me a compile error "Method or data member not found". My statement looks like this:

If Application.Version = "9.0" Then Selection.NoProofing = False

The Selection.NoProofing is not available in 97. I've tried On Error Resume Next and On Error GoTo 0 but neither work.
DCCoolBreeze (Programmer)
3 Aug 01 8:02
Sure...error handling will not work for methods that do not exist.  If I understand your question correctly...check for the version of word...

example:

  if (application == word2000) then
     ...
  else
     ...
  endif

Hope this helps...
BarryG (Programmer)
3 Aug 01 9:27
DC,

Thanks for your reply. This is what I tried, but the then portion of this statement needs to include the .NoProofing method, which is valid in Word2000 but not in Word97.

What I decided to do is to break this statement out into a function that I call from my main procedure. This way the code doesn't try to compile until the if statement evaluates to true.

Sub main()
if application.version = "9.0" then
temp = NoProof()
end if
End Sub

NoProof()
Selection.NoProofing = False
End Function


This seemed to work.

Thanks for your suggestion.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close