PC Review


Reply
Thread Tools Rate Thread

Formatting StyleRef in headers in Word 2007

 
 
Butterfly Bill
Guest
Posts: n/a
 
      4th Aug 2009
I have been having this problem with my Word 2007 (12.0.a bunch more
numbers):

If I assign to a chapter name the style Heading 1,
and then in the page headers put in StyleRef fields for Heading 1,
and some of the names have three or more words,
and I format the whole name field in the header in something like
Bold,

sometimes not all of the words in the name in the header come out
formatted the same. If the name of one were "the Very First Chapter",
sometimes only "The Very" or The Very First" will come out in Bold.
The rest of the words are in whatever is the Normal font. This happens
with character styles, fonts, and sizes.

This happens when I open up a document that has been saved after
closing Word and reopening it. If I go into Edit Header and correct
them all, then save it, all the corrections are lost the next time I
open it.

This is frustrating because I want to use different fonts in the
headers.

Anybody else have this problem? Is there a way to fix it? It seems
like a glitch in the Word program.

-Butterfly Bill
 
Reply With Quote
 
 
 
 
macropod
Guest
Posts: n/a
 
      4th Aug 2009
Hi Butterfly Bill,

The 'correct' way to do impose a particular format on the StyleRef field's output is to insert it into a paragraph with the correct
Style formatting or to use a Charformat switch. To use the Charformat switch:
.. select the field and press Shift-F9 to expose the field code. It should look like { STYLEREF "Heading 1" } or { STYLEREF "Heading
1" \* MERGEFORMAT }
.. delete the '\* MERGEFORMAT' switch (if present) and insert a '\* CHARFORMAT' switch (ie { STYLEREF "Heading 1" \* CHARFORMAT })
.. Format the 'S' in 'STYLEREF' with the format you require
.. Press F9 to update the field.

In any event, I'd recommend deleting the '\* MERGEFORMAT' switch.


--
Cheers
macropod
[Microsoft MVP - Word]


"Butterfly Bill" <(E-Mail Removed)> wrote in message
news:e5644f1a-bb6c-48dd-b86b-(E-Mail Removed)...
>I have been having this problem with my Word 2007 (12.0.a bunch more
> numbers):
>
> If I assign to a chapter name the style Heading 1,
> and then in the page headers put in StyleRef fields for Heading 1,
> and some of the names have three or more words,
> and I format the whole name field in the header in something like
> Bold,
>
> sometimes not all of the words in the name in the header come out
> formatted the same. If the name of one were "the Very First Chapter",
> sometimes only "The Very" or The Very First" will come out in Bold.
> The rest of the words are in whatever is the Normal font. This happens
> with character styles, fonts, and sizes.
>
> This happens when I open up a document that has been saved after
> closing Word and reopening it. If I go into Edit Header and correct
> them all, then save it, all the corrections are lost the next time I
> open it.
>
> This is frustrating because I want to use different fonts in the
> headers.
>
> Anybody else have this problem? Is there a way to fix it? It seems
> like a glitch in the Word program.
>
> -Butterfly Bill


 
Reply With Quote
 
Butterfly Bill
Guest
Posts: n/a
 
      4th Aug 2009
On Aug 3, 5:45*pm, "macropod" <macro...@invalid.invalid> wrote:

> The 'correct' way to do impose a particular format on the StyleRef field's output is to insert it into a paragraph with the correct
> Style formatting or to use a Charformat switch. To use the Charformat switch:
> . select the field and press Shift-F9 to expose the field code. It shouldlook like { STYLEREF "Heading 1" } or { STYLEREF "Heading
> 1" \* MERGEFORMAT }
> . delete the '\* MERGEFORMAT' switch (if present) and insert a '\* CHARFORMAT' switch (ie { STYLEREF "Heading 1" \* CHARFORMAT })
> . Format the 'S' in 'STYLEREF' with the format you require
> . Press F9 to update the field.
>


OK, I changed the field code directly as you said, and it's starting
to look like it worked, but what are the precise meanings of those two
switch codes?
 
Reply With Quote
 
macropod
Guest
Posts: n/a
 
      4th Aug 2009

Hi Butterfly Bill,

The MERGEFORMAT switch is used to retain the formatting of the source. That's why applying a different format to the output doesn't
give consistent results.

The CHARFORMAT formats a field's output to match whatever formatting is applied to the first character in the field.

The use of both switches is discussed in Word's Help file.

--
Cheers
macropod
[Microsoft MVP - Word]


"Butterfly Bill" <(E-Mail Removed)> wrote in message
news:b86bb641-5923-465c-b9b6-(E-Mail Removed)...
On Aug 3, 5:45 pm, "macropod" <macro...@invalid.invalid> wrote:

> The 'correct' way to do impose a particular format on the StyleRef field's output is to insert it into a paragraph with the
> correct
> Style formatting or to use a Charformat switch. To use the Charformat switch:
> . select the field and press Shift-F9 to expose the field code. It should look like { STYLEREF "Heading 1" } or { STYLEREF
> "Heading
> 1" \* MERGEFORMAT }
> . delete the '\* MERGEFORMAT' switch (if present) and insert a '\* CHARFORMAT' switch (ie { STYLEREF "Heading 1" \* CHARFORMAT })
> . Format the 'S' in 'STYLEREF' with the format you require
> . Press F9 to update the field.
>


OK, I changed the field code directly as you said, and it's starting
to look like it worked, but what are the precise meanings of those two
switch codes?

 
Reply With Quote
 
Stefan Blom
Guest
Posts: n/a
 
      4th Aug 2009

Butterfly Bill,

for more, see the "Add a formatting switch to a field code" section in the
article at
http://office.microsoft.com/en-us/wo...CH100992711033
("Insert and format field codes").

--
Stefan Blom
Microsoft Word MVP



"macropod" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi Butterfly Bill,
>
> The MERGEFORMAT switch is used to retain the formatting of the source.
> That's why applying a different format to the output doesn't give
> consistent results.
>
> The CHARFORMAT formats a field's output to match whatever formatting is
> applied to the first character in the field.
>
> The use of both switches is discussed in Word's Help file.
>
> --
> Cheers
> macropod
> [Microsoft MVP - Word]
>
>
> "Butterfly Bill" <(E-Mail Removed)> wrote in message
> news:b86bb641-5923-465c-b9b6-(E-Mail Removed)...
> On Aug 3, 5:45 pm, "macropod" <macro...@invalid.invalid> wrote:
>
>> The 'correct' way to do impose a particular format on the StyleRef
>> field's output is to insert it into a paragraph with the correct
>> Style formatting or to use a Charformat switch. To use the Charformat
>> switch:
>> . select the field and press Shift-F9 to expose the field code. It should
>> look like { STYLEREF "Heading 1" } or { STYLEREF "Heading
>> 1" \* MERGEFORMAT }
>> . delete the '\* MERGEFORMAT' switch (if present) and insert a '\*
>> CHARFORMAT' switch (ie { STYLEREF "Heading 1" \* CHARFORMAT })
>> . Format the 'S' in 'STYLEREF' with the format you require
>> . Press F9 to update the field.
>>

>
> OK, I changed the field code directly as you said, and it's starting
> to look like it worked, but what are the precise meanings of those two
> switch codes?





 
Reply With Quote
 
New Member
Join Date: Nov 2009
Posts: 1
 
      8th Nov 2009
Hello,
i have question about the StyleRef field.

I have a title of a chapter with a italic text like this:

Title with a italic text

The size are set to the style "Headings 1" and the italic is set locally in the title.

I used the styleref filed for the header of all that section, but i would like to mantain tha italic format just for the last 2 words. I check the MARGEFORMAT option, but the field can be all italic o all normal, not mixed as the refered text.

Can i solve this problem?
Thank you.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using StyleRef for Headers trj27 Microsoft Word Document Management 1 21st Dec 2009 11:27 PM
Altering formatting in headers when using StyleRef trj27 Microsoft Word Document Management 1 21st Oct 2009 01:55 AM
StyleRef formatting issues for auto-generated headers Dan Microsoft Word Document Management 3 22nd May 2008 02:33 AM
Using Field/Styleref in Headers ... =?Utf-8?B?U2hhcm9uIFIu?= Microsoft Word Document Management 5 17th Aug 2007 02:08 PM
Headings, STYLEREF and Headers Mike2001 Microsoft Word Document Management 2 13th Jun 2007 04:51 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:55 AM.