Style names in Word templates for international use

J

John Nurick

Hi,

I'm helping plan a rollout of Word 2007 including custom ribbons and
templates, and am looking for information on how to have localised
custom style names for users around the world without having to
support multiple national versions of all the templates.

For example, we want the style whose ID is wdStyleHeading2
(styleID="Heading2 in the XML) to appear for English-speaking users as
"Section Heading" but in German it might need to be something like
"Absatztitel", and different again in other languages.

Any suggestions or pointers to documentation will be much appreciated.

Regards,
John
 
D

Doug Robbins - Word MVP

There is no much traffic in this newsgroup.

However, you might find some leads at
http://msdn.microsoft.com/en-us/library/4f9sc85k(VS.80).aspx

Or in one of the MSDN forums.

If you were able to confine all of your Ribbon Customizations to a single
add-in for each language, that might not be too difficult to manage.

I know just enough xml to use the Ribbon Customizer, and do not know if you
can use the equivalent of a VBA Select Case construction that would use
different labels based on the language.

--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.
 
J

John Nurick

Thanks, Doug.

It's turned out to be far easier and more effective to customize the
Ribbon than I ever expected, and if necessary we'll be able to have a
global add-in load a localized ribbon or even construct one at startup
(collecting text from a resource file).

The bit that I'm stuck on is how to achieve locale-specific
_customized_ names for built-in styles.

Regards,
John
 
D

Doug Robbins - Word MVP

I was thinking that your ribbon modifications might include buttons for the
styles that you want to be used and that you could handle the language
differences by the labels for the buttons.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
T

Tony Jollans

I'm a little confused by the question. Built-in styles are localised -
wdStyleHeading2 is "Heading 2" in English, and "Überschrift 2" in German -
and this does cause some problems. As far as I know it is not possible to
localise custom style names.
 
L

Lene Fredborg

Just for your information, I have made two pages on my Website concerning
style names:

â€Word style names in English, Danish, German, French":
http://www.thedoctools.com/index.php?show=wt_style_names_english_danish_german_french
From that page, you can open a PDF document with an overview of all the
built-in style names in English, Danish, German and French - incl.
information about the corresponding VBA constants.

â€Macro – create list of local built-in style namesâ€:
http://www.thedoctools.com/index.php?show=mt_create_style_name_list
On the page, I have described some of the problems related to localized
style names. In addition, you can download a Word-document including macros
that let you create a list of the style names in the locally installed
language version of Word.

--
Regards
Lene Fredborg - Microsoft MVP (Word)
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word
 
J

John Nurick

I'll be having buttons and/or dropdowns to apply the most common
styles, but also need a control that displays the name of the style of
the text where the insertion point is and allows less common styles to
be applied. I suppose I could have some lookup tables to translate the
style name in the document to the style name the user sees, depending
on the language, but I feel it would be a nightmare to try and make
that work flawlessly.
 
J

John Nurick

Hi Tony,

Probably I should have expressed it more clearly. I'm hoping to (a)
have custom styles whose names are different in different languages,
and (b) have custom names for built-in styles and have those too be
different in different languages.

Examples: (a) "Branch" (en), "Zweigstelle" (de), "Succursale" (fr)

(b) wdStyleHeading2: "Section" (en), "Absatztitel" (de), "Section"
(fr)

John
 
D

Doug Robbins - Word MVP

Not sure if you can make use of the dialog that displays the style of the
selected text, calling which via vba can only be done by the use of (AFAIK)

SendKeys "^+s"

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
J

John Nurick

Actually with the Ribbon it's not unbearably difficult to have custom
controls that change according to the characteristics of the
selection, e.g. a styles dropdown that displays the name of the
current style whatever it is, but only lets the user select from a
subset of styles.

The tricky bit would be hiding from the user the fact that the "style
names" they see aren't the actual names of the styles in the document.
I think it would be difficult enough to maintain this illusion in a
corporate environment, and unacceptably confusing when sharing
documents outside that environment. Hence my desire to customise the
actual names of the built-in styles ... but only if that doesn't make
internationalization impossibly complicated. <g>

John
 
Joined
Mar 5, 2012
Messages
1
Reaction score
0
Solution

Hello,

maybe this thread is dead but I was searching for the same thing and want to leave the solution here. You can get the translated name of builtin styles as follows:


Code:
ActiveDocument.Styles(wdStyleHeading1).NameLocal

This especially also works for Selection.Style:

Code:
If Selection.Style = ActiveDocument.Styles(wdStyleHeading1).NameLocal Then 
     MsgBox "heading 1 selected" 
End If

Source:
microsoft.public.word.word97vba
"Problems using wdStyle constants"
Google search: microsoft.public.word.word97vba "Problems using wdStyle constants"

Regards.
 

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