Template styles - language change

  • Thread starter Roderick O'Regan
  • Start date
R

Roderick O'Regan

I have a template from my client which uses Heading 1, 2, 3 in their
text and they are used in the document's TOC.

They now want to give this template to their Lisbon office who are
using the Portuguese version of Word.

When that version of Word gets hold of the in-built style headings, it
will automatically change these to "Titulo 1", 2, 3, etc.

In my template modules I have a line of code which applies Heading 1
to a selection as follows:
Selection.Style = ActiveDocument.Styles("Heading 1")

Is there a way I can say something like:
If Heading 1 exisits in the template styles then apply it.
Otherwise see if it has changed to "Titulo 1" and apply that one?

Thanks

Roderick
 
S

Shauna Kelly

Hi Roderick

You can use the built-in enumeration for built-in styles, for example:
Selection.Style = ActiveDocument.Styles(wdStyleHeading1)

To see a full list of the available values, click on the wdStyleHeading1 and
press Shift-F2 to see the object browser.

You might also like to review the use of any STYLEREF fields. Use { STYLEREF
1 } instead of { STYLEREF "Heading 1" }.

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
 
J

Jay Freedman

Because you're dealing with the built-in styles, you can use predefined
constants that are language-independent, such as:

Selection.Style=ActiveDocument.Styles(wdStyleHeading1)

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

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