Changing Names of the Styles...

S

sorcerer

Hi Guys..
Is there any method or property to change the name
of the Style..For example Change Heading 1 Style from Arial 18
to Times New Roman 17 and then to change its name to default heading 1.
Usually it apperars as Heading 1+Times New Roman.
But I want to see only Heading 1 in the Styles..
 
C

Charles Kenyon

You can modify the style so that it uses the font you want. Then you will
see Heading 1 in styles and it will have TNR font instead of Arial. Are you
trying to do this through a macro for some reason? (This newsgroup is about
macros.)
http://addbalance.com/usersguide/styles.htm
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
S

sorcerer

Hi Charles..
I couldn't see any worth while macros in that Syles..website
http://addbalance.com/word
I know to do the stuff using word. But I was told to do the same
explicitly using
programs. i.e macros.. Can you help. This is what happens in Word..
The Source Document has some text in Heading 1 Format as shown in the
formatting box on Top Left Toolbar. I find it and then change it to my
style Arial 18 Bold.
Then what happens in the formatting box is that it shows Heading
1+Arial..
I want it to show only Heading 1. Is that possible using word macros.
 
J

Jean-Guy Marcil

sorcerer was telling us:
sorcerer nous racontait que :
Hi Charles..
I couldn't see any worth while macros in that Syles..website
http://addbalance.com/word
I know to do the stuff using word. But I was told to do the same
explicitly using
programs. i.e macros.. Can you help. This is what happens in Word..
The Source Document has some text in Heading 1 Format as shown in the
formatting box on Top Left Toolbar. I find it and then change it to my
style Arial 18 Bold.
Then what happens in the formatting box is that it shows Heading
1+Arial..
I want it to show only Heading 1. Is that possible using word macros.

If you apply some formatting changes to a paragraph, the style has not
changed at all. The local paragraph is formatted differently from its style.
The name change you see is because in Tools > Options > Edit tab > Keep
Track of Formatting is checked.
Uncheck it and the style name will not change in the style drop down.

Still, you have not changed the style definition if you only have applied
local changes to a paragraph. In code, to change a style definition (and
therefore automatically apply this change to all paragraph that are
formatted with this style, try this:

'______________________________________
Sub ChangeStyle()

Const myStyleName As String = "Heading 1"
Dim myStyle As Style

Set myStyle = ActiveDocument.Styles(myStyleName)

With myStyle
With .Font
.Name = "Times New Roman"
.Bold = False
.Size = 32
End With
.ParagraphFormat.Alignment = wdAlignParagraphCenter
End With

End Sub
'______________________________________

Just change the name of the style in the first line of the code and use the
..Font/.ParagraphFormat properties you need.
--
Salut!
______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
C

Charles Kenyon

Do I know how to modify a style using vba? I'm sorry, I do not.

The key thing is to modify the style, not just the formatting, which is what
you have been doing.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
S

sorcerer

Hey I've tried all what was said here.
Just one clarification...
I need to rename all "heading 1" styles as "copyright heading 1"
with the same formatting, font name, size and all. Just change the name
of the style from "heading 1" to "copyright heading 1"
Is it possible to do so..using macros.
 
C

Charles Kenyon

It is _not_ possible to change the name of a heading style. You can add an
alias or shortcut name to the style so that it would show up if you typed
"copyright heading 1" in the style pane. Otherwise, you would have to create
the style.

The following was posted by MVP Margaret Aldis in the last day or so and may
be of help:
I think what you're looking for is in the Styles and Formatting pane. Select
text with required formatting but not in the style, and then from the
dropdown beside Heading 1 or whatever you can choose "Update to match
selection". The built-in style is then updated to match the example.

Neat feature - I keep forgetting about it as I rarely work that way now, but
I remember tearing my hair out in earlier versions of Word in search of a
way to do this ;-)


--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
S

sorcerer

Hey Charles...
I got the solution.
I could not modify and rename built in Styles..
But I was able to create my own custom styles and give them a name that
I want.

Thanks anyway
 

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