Fonts for Word "Fields" when setting values

V

Veera

We have a java application in which we create custom fields in MS Word using
JACOB. On user initiation the fields are populated with values. If after
creating the fields and change the FONT to a BARCODE font and when the fields
are getting replaced with values, the BarCode font is not retained. The
values are shown in original font. This happens only in Word 2003. The Bar
Code font is retained for field values in Word 2000.

Is there any setting or property to be set so that Bar Code fonts are
retained for field values. The machine has Bar Code fonts installed.

Thanks in advance for any suggestion.
 
V

Veera

Thanks for the reply.

We already have "*" infront and back of the fileds. I tried inlcuding \* and
didn't help either.

I have the fields like this in the Word Document

*<<Enter ID>>*

I select the entire field and set Bar Code font. But if I place the cursor
after "<<" in the field the font shows the previous value instead of the
selected Bar Code font.
 
C

Cindy Meister

You misunderstand me. *<<Enter ID>>* isn't a Word field, in and of itself,
although it may be the screen representation of one. I can't judge that. You
edit field codes like this:

Alt+F9 to show the field codes.

Add the switch at the end of the BARCODE field code, following this pattern

{ FieldName "other arguments" \* CharFormat }

Alt+F9 again to turn off the field code display.

The CharFormat switch forces the field code to retain the font formatting
applied to the first character of the field CODE.
 
V

Veera

This is what the field looks when i do Alt F9

*{MERGEFIELD "Enter ID" \* MERGEFORMAT}*

This is what it appears to the user *<<Enter ID>>* before populating the
values.
 
C

Cindy Meister

Replace MergeFormat with CharFormat for the BARCODE field and any other field
that is not retaining the correct font formatting.
 
V

Veera

Thanks for the reply. But no luck.

I create the field and change the font to Barcode. When i access the field
programatically and check the font, it is returning "" (empty string) instead
of the barcode font name. May be that is the reason the font is not being
retained.

Is there any settings in Word were the fonts are registered?
 
V

Veera

Thanks Cindy for all your help.

I couldn't find a proper solution, so did we did work around by removing the
chevron "<<" character from the fields and changing the font. This way when
the value for the field is set the font is retained.
 
C

Cindy Meister

No, there's no place in Word where you can do anything with the fonts except
specify which ones are used for substitution when you get a document and the
fonts in it aren't installed on your machine (that's in
Tools/Options/Compatibility).

Word is "picky" about keeping so-called Symbol fonts separate from "regular"
fonts. Perhaps there's something in this font's definition that's causing a
problem.

If you apply a "regular" font to this field, for testing purposes, is that
retained on field update (unlike the Barcode font)?
 

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