Office 2007 VB conditional compilation

N

NeilL

I have a Word document template for Office 2003. I've migrated the template
to Office 2007 and added customization for the RibbonUI which is working
fine. Since the only differences between the 2003 and 2007 templates are the
file extension (dot vs dotm) and the inclusion of code specific to setting up
the ribbon UI elements, what I want to do is now back port the template
source to Office 2003.

I know I need to save as the template but my issue is that there are objects
and functions with arguments being passed specific to the ribbon UI that are
not defined in Office 2003.

What I'm looking for is any conditional compilation I can use so that these
functions can be #IF ... conditionally included or excluded based on the Word
version.

Are there any Office 2003 or 2007 constants/variables that can be used for
this purpose?

Thanks
 
J

Jonathan West

NeilL said:
I have a Word document template for Office 2003. I've migrated the template
to Office 2007 and added customization for the RibbonUI which is working
fine. Since the only differences between the 2003 and 2007 templates are
the
file extension (dot vs dotm) and the inclusion of code specific to setting
up
the ribbon UI elements, what I want to do is now back port the template
source to Office 2003.

I know I need to save as the template but my issue is that there are
objects
and functions with arguments being passed specific to the ribbon UI that
are
not defined in Office 2003.

What I'm looking for is any conditional compilation I can use so that
these
functions can be #IF ... conditionally included or excluded based on the
Word
version.

Are there any Office 2003 or 2007 constants/variables that can be used for
this purpose?
As far as I'm aware this sn't a specific compilation constant. What you can
do is place all the office 2007-specific code into separate modules, If no
code in that module is ever called when the template is used in Word 2003,
then the template will run OK.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
N

NeilL

Ah, thanks. I'll give that a try.
--
Neil


Jonathan West said:
As far as I'm aware this sn't a specific compilation constant. What you can
do is place all the office 2007-specific code into separate modules, If no
code in that module is ever called when the template is used in Word 2003,
then the template will run OK.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.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