Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Jan 2004
    Location
    Mount Prospect, Illinois
    Posts
    142
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cross-version macros (97-2003)

    Outside of this thread, has anyone come across a good way to create macros that use the best features of whatever Word version is available?

    For '97-specific versions, it was possible to look for the conditional compilation variable VBA6, and if false, you knew it was '97, so you'd find an alternative to split, you'd do something to avoid certain bugs like not being able to replace found formatting with an empty string...

    But for 2000 vs XP or 2003, I can't find any similar constant that can be used.
    Certain features, such as new Options properties, will cause compilation errors if opened in 2000. I could assign the Options object to a 'blind' object and do late binding. I'll do that as a last resort, but it just makes me wear down my molars [img]/forums/images/smilies/wink.gif[/img]

    Any other suggestions?

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Cross-version macros (97-2003)

    This is not necessarily any less damaging to your teeth, but I believe you can tick or untick a box in the VBE project options that is similar to "compile module when accessed." If this works as it sounds as though it should, you then could isolate code for later versions of Word in procedures in separate modules and call them if needed after testing Application.Version. Obviously you'd have to pass the objects over, issues could arise... hey, I didn't say it would be easy. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

  3. #3
    2 Star Lounger
    Join Date
    Jan 2004
    Location
    Mount Prospect, Illinois
    Posts
    142
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cross-version macros (97-2003)

    Probably you mean "Compile on Demand"
    That still sounds like it would have the potential for the user to stumble onto a compile-level error, which is never a nice thing.
    I usually like to do a full compile of the project prior to saving and shipping to my clients, to be sure there's no errors lurking, and that would be difficult with this method. Late binding sounds better all the time.

    Joel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •