Word Object Model - English vs Spanish

I

Ignacio Hernandez

Hi All,

I'm modifying a script for creating a configuration report in Word. I tried
first in a computer running the english version of Word for Office XP and it
ran very well. Then I tried in a computer running the spanish version of
Word 2003 and it was a mess. My questions are:
1. Has the object model changed from Word XP to Word 2003?
2. Are there any special names when calling objects in different language
version of Word?

Thanks,

Ignacio
 
P

Pete Bennett

It /should/ be the same....

However, there are differences in the user interface/styles that will have
an impact on your VBA code if it's not written to be internationally aware
(as most code should be).

Built in styles have enumerators in the Word object model (i.e
wdStyleNormal, wdStyleHeading1, etc) and these should be used in preference
to ActiveDocument.Styles("Normal"), use Activedocument.Styles(wdStyleNormal)
instead.

File paths are likely to be different, so use the
Word.Options.DefaultFilePath to get to them (don't assume everything's going
to be "C:\Program Files\Microsoft Office" etc).

Built in Commandbars, annoyingly, don't have enumerators, so you're going to
have to know what the name of the toolbar is you're trying to access is.

VBA and the builtin enumerators should be exactly the same across different
language version.

If none of these are your problem, then you should post the error messages
you're getting and then we can suggest further avenues for you to explore.

Regards,

Pete.
 
I

Ignacio Hernandez

Hi Pete,

Using the enumerators solve most of the problems. Thanks! Regarding the
fonts name, is there also an "indirect" way to call them? Names like
Trebuchet MS don't seem to be recognized, although the font is properly
installed.

Thanks again,

Ignacio
 
H

Howard Kaikow

If the names of the fonts are different in each language, include code that
assigns the name to a string variable, and change the assignment at run-time
based on language version of Word.
 

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