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 / October 2007

Tip: Looking for answers? Try searching our database.

Template styles - language change

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Roderick O'Regan - 02 Oct 2007 15:48 GMT
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
Shauna Kelly - 02 Oct 2007 15:56 GMT
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

>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.
[quoted text clipped - 16 lines]
>
> Roderick
Jay Freedman - 02 Oct 2007 15:59 GMT
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)

Signature

Regards,
Jay Freedman
Microsoft Word MVP        FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

> 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.
[quoted text clipped - 16 lines]
>
> Roderick
Roderick O'Regan - 02 Oct 2007 18:43 GMT
Thank you Shauna and Jay for the reply.

Just what I needed.

Roderick

>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)
 
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.