Problem with STYLEREF and IF

F

Fambrius

Hello.

I'm trying to do what is discussed in
http://groups.google.com.au/group/m...read/thread/75edec3265f57b71/f136ec54f4fbefad

But the problem I have is that I put the following code in my Word 2003 SP2
in Spanish document:
{ IF 1 < 2 {STYLEREF 2} 4 }

And it is converted into:
{STYLEREF

It seems that it doesn't "compile" {STYLEREF 2}.

I have also tried the following code:
{ IF 1 < 2 "{STYLEREF 2}" 4 }
but it generates:
{STYLEREF 2}

Anyone can imagine why my Word document doesn't convert the STYLEREF into
the words that are contained into my heading?

Thanks in advance.
 
S

Suzanne S. Barnhill

Are you inserting the StyleRef field by pressing Ctrl+F9 rather than just
typing the braces?

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
G

Guest

If I understand your description correctly, you see the text "{STYLEREF" or
"{STYLERF 2}" in your document after updating the field(s).

I made a test and found that I could produce something similar if I entered
no. 2 and no. 3 bracket as "normal" characters - i.e. not by pressing
Ctrl+F9. Field brackets must always be created by pressing Ctrl+F9 - they
cannot be typed.

I suggest you try to recreate the field code, making sure to use Ctrl+F9,
and see whether that solves the problem.

Note: If you turn on formatting marks (Ctrl+Shift+8); correctly inserted
field brackets will be surrounded by a tiny, dotted outline whereas "normal"
character brackets have no outline.

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

Fambrius

Hello.

I created the main braces with Ctrl+F9, but I typed the inner braces :-(

Thank you very much, now it works. I didn't see anywhere in the
documentation that the inner braces had to be created with Ctrl+F9 also.

Thanks again :)
 
F

Fambrius

Hello.

You're right, I hadn't created the inner braces with Ctrl+F9.

Thank you very much :)
 
G

Graham Mayor

No field boundaries can be simply typed from the keyboard.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

Suzanne S. Barnhill

The only way to create a field by hand (other than by using Insert | Field)
is by pressing Ctrl+F9, either before typing the field code or after (with
it selected).

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

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