Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / June 2005

Tip: Looking for answers? Try searching our database.

Using "Table.Style" in pre-2003 Word

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Michael Kellogg - 09 Jun 2005 01:01 GMT
I have a module that formats a table using the "Table.Style" property.  It
runs in 2003 and I think it runs find in 2002, as well.  However, I have
one or two users who have Word 2000 and it throws a compiler error for
them, it says it does not recognize that "style" member.

Can I either use some sort of pre-compiler "#IF" type statement in
conjunction with the Word 2000 counterpart to "Table.Style" (assuming there
is one), or do this in another way?  I'd rather not remove that line
altogether in order to get everyone working.

Thanks in advance for any suggestions.

Signature

Michael Kellogg

Cindy M  -WordMVP- - 10 Jun 2005 08:17 GMT
Hi Michael,

> I have a module that formats a table using the "Table.Style" property.  It
> runs in 2003 and I think it runs find in 2002, as well.  However, I have
[quoted text clipped - 5 lines]
> is one), or do this in another way?  I'd rather not remove that line
> altogether in order to get everyone working.

Unfortunately no, there's no way to precompile. What can work is to place all
non-Word 2000 code in a separate module. Under ideal circumstances, Word only
compiles a module when it's actively called during execution. So placing
"problem" code in a separate module, then doing a version check and branching
should work.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)
Michael Bednarek - 10 Jun 2005 13:53 GMT
>I have a module that formats a table using the "Table.Style" property.  It
>runs in 2003 and I think it runs find in 2002, as well.  However, I have
[quoted text clipped - 7 lines]
>
>Thanks in advance for any suggestions.

If you need to write VBA code which is backwards compatible, you have to
use the smallest common denominator. In this case, tblTable.AutoFormat()
might do the trick. Alternatively, you can address each design element
of a table and set it explicitly.

There's a lucid article on table formatting in VBA specifically for
Word 9 (aka 2000) at
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnovba00/html/T
ableStyles.asp
>.

You might also want to read this thread:
<http://groups-beta.google.com/group/microsoft.public.word.tables/browse_thread/t
hread/6d088291863234a9/1aefcee19a379e99
>
or
<http://groups.google.fi/groups?hl=en&threadm=2F69F2B7-37C4-4E64-ADCE-4FF9EF405FE
3%40microsoft.com
>
(The second link is to one of the few Google Group sites which have so
far escaped the "new improved" (ha!) beta treatment.)

Signature

Michael Bednarek   http://mbednarek.com/   "POST NO BILLS"

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.