StyleRef Formatting Frustrations

L

Lene Fredborg

I understand your sigh!

When testing the form fields before posting last time, I actually forgot
about your original description of the StyleRef problem (my mistake, sorry).
I have now tested more here. What I see here is a bit different from what you
describe (and while I was testing etc., Stefan’s and Suzanne’s most recent
posts appeared…):

I have tried to repeat the exact steps you describe - and I did it more than
once.
My StyleRef field show MS Mincho before I type text in the protected form,
but as soon as I start typing, the font in the StyleRef field is
automatically corrected (i.e. no more MS Mincho here).

I also tried doing things in a different order and with different fonts used
in the underlying paragraph styles in the main body and the header, but the
result was the same: the StyleRef field corrects itself to the correct font
when I start typing in the text form field in the protected form.

So for some unknown reason, I seem be luckier with the final result of the
StyleRef field than you. Unfortunately, I don’t have any good ideas of how to
cure your StyleRef font problem if your font removal does not make any
difference.

-------------------------
Now, a bit later - after having read the KB article (link from Stefan’s
post: http://support.microsoft.com/kb/828501/en-us):

I tried to follow the instructions in the article: First applied the style
(in this case the character style), then created the text form field. If I
placed the cursor at one of the ends of the form field in the unprotected
form, the â€Style†field in the Formatting toolbar shows that the character
style was applied. However, when I selected the entire form field, the
“Style†field was empty, indicating that different styles were in use in the
selection. But the text form field looked OK (correct font). I inserted a
StyleRef field in the header with the correct name of the character style.
Even if formatting marks were shown, the StyleRef field did not reflect the
empty text form field.

I now protected the document and typed text in the form field. BUT the
StyleRef field remained blank (and did not show any error either). First when
I unprotected the document, selected the form field with its text and
reapplied the character style, the text appeared in the StyleRef field. I
could reproduce this behavior (tried a number of times). So the method
described in the KB article may seem to solve the problem but something wrong
is going on under the surface…

I have tested in both Word 2003 and 2007. I have only seen the above
problems in Word 2003 whereas Word 2007 has shown the correct font and style.

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

Dax Arroway

OMG!!! That works. OK, so the answer seems to be:

Insert form field,
Apply character style,
Use Reset Form Fields to get it to switch back to desired font,
Insert StyleRef into pre-formatted paragraph in footer/header,
Ignore false font listing because it will correct itself when the locked
form field has text entered into it.
Lock the doc,
And type into the form to make sure the auto-correct is happening.

I've assigned different fonts to the form fields and left the assigned
footer font and when I type intot he form field, the footer autocorrects to
the footer font. I've changed the footer font from one font to the other and
I get the same results. I think this cracks it. *fingers crossed* We'll
see what happens when I let it out on the server on Monday.

I'd like to thank all who have chimed in on this issue. It's turned into a
party! All your input has been invaluable and I really appreciate your
attention. Thank you!

--Dax Arroway
 
B

Beth Melton

I've encountered this issue numerous times and never had any international
languages enabled either. I forget why this occurs and I can't seem to find
an email I once had that provided the reason for it. I do know it wasn’t the
same as the KB article Stefan cited. But I do know the workaround provided
in the article does work and that is to apply the style before you insert
the form field. I noted your document uses direct formatting instead of
styles and I don't recall this occurring with direct formatting. As a matter
of fact that is one of the workarounds. Perhaps it's because the Normal
style has been modified? In any event, if you're not familiar with how to
create a style follow these steps:

- Place your insertion point in the location in one of your text form fields
(this will enable the style to pick up your existing formats)
- From the Format menu, click Styles and Formatting
- On the Styles and Formatting task pane, click New Style
- Provide a name for your style, such as Form Fields
- Verify the formats
- Click OK

Note that it's been awhile since I've used Word 2003 so the above steps and
command names may be slightly different - I'm going on memory. :)

Then once your Style is created, delete each text form field, apply the
style, and then insert the text form field again. I used this method a lot
when creating forms in Word 2003 so it should work for you. Thankfully you
only have a few text form fields. When I first encountered the issue it was
on three forms, each with over 100 form fields most of which had various
Property changes, macros assigned, every form field was named, etc. Needless
to say I was not a happy camper!

~Beth Melton
Microsoft Office MVP
 
L

Lene Fredborg

I am glad you can make it work now too. Hope it also works on Monday.

Actually, I am sure the time I spent testing in relation to your question
will help me later. I have registered the problem many times without taking
the time to really find out what was going on.

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

Beth Melton

If this doesn't work then trying applying the character style before
inserting your form field. That should be enough to correct the issue.

~Beth Melton
Microsoft Office MVP
 
B

Beth Melton

What's really going on is a bug. :)

I finally located an old email on this issue and this is what I was told
when I reported it:

"The cause is a bug in a “font fix-up†routine. This routine is used when
dealing with Asian fonts. Asian fonts are different in that font
substitution is frequently needed as the fonts are frequently not on the
system, and also in that text written in Asian fonts frequently needs to be
increased in point size to look good in Asian documents. I know this sounds
unrelated to the bug you reported, but the bug is that font fix-up is
running when it shouldn’t."

~Beth Melton
Microsoft Office MVP
 
L

Lene Fredborg

OK, I did not mean it wasn’t a bug :). I only meant that now I know more
precisely what I can expect to happen when - and what to do to compensate for
the wrong behavior.

Hopefully, Microsoft will fix the bug some day since they obviously know
what causes it.

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

Beth Melton

Gotcha. :)

I'm not able to reproduce this behavior on newly created documents in Word
2007 so it may have been corrected. I know in Word 2002 and 2003 if you
applied a style to a form field and then protected the document you'd see
the font change immediately. Of course I don't know if it will crop up under
specific circumstances in Word 2007 since after my encounter with it I now
apply the styles prior to inserting form fields. It only takes encountering
a bug once and spending hours recreating 100s of form fields to vow to never
allow it to happen again! <grin>

~Beth Melton
Microsoft Office MVP
 
L

Lene Fredborg

As mentioned in one of my previous posts in this thread, I have also tested
in Word 2007 and until now I have not seen the problem in that version (I
have SP2 installed).

For me, the font changes to MS Mincho in Word 2003 as soon as I apply a
style or press Ctrl+Spacebar (even if there is no direct formatting to
remove). I do not have to protect the document in order to provoke the bug.

Also note that if a StyleRef field is involved, it is not sufficient for me
to follow the instructions in the KB article. Even if I apply the style
first, the StyleRef field does not work correctly - it does not get updated
when typing text in the form field. It only works if I reset the form fields
first (for further details, see the previous post).

And yes, I know the feeling of first spending hours on digging into a
problem and then spending hours or days on making corrections to compensate
for a bug. I have nothing positive to say about how that feels <g>.

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

Caroline Horner

I think I figured it out.

You have to delete the form field and then re-insert it. That seemed to
work for me, but I know what you mean...very frustrating!

I also deleted the MS fonts, but that didn't seem to make a damn bit of
difference.

Let me kow how you go.

Caroline Horner
 
S

Stefan Blom

What you have found is implicit in the article: if you have already done it
the "wrong" way, you will have to delete the form fields and start over.
 

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