DocVariable and font caracteristics question

E

Eric L

Hello,
i am working on a little DocVariable based template and i was unable
to find any answer on the "possibility" of the following:

I created my DOCVARIABLE Field (actually many of them)
I have no problems using vba to add them to my document and manage them
and update their value & al

Now my issue lies here.

While i found out that using \* CHARFORMAT switch in my field code i can
modify the font and style of my field and its persistant thru update (when
you applies the font and style to the first character of the {[D]OCVARIABLE
"varname" \* CHARFORMAT}, its pretty neat but what if i would like to use
field for scientific notation

lets say my field is named watermolecule and the value is H2O, is it
possible to set 2 as superscript?

I found out that if i set the D to superscript then my value H2O will be all
superscript.

I know that i can use the "ascii" code 0178 to get 2 in "superscript" but my
goal objective contain many others number and caracter in superscript or
subscript and different format for some part of the string in value ex: value
= BOLD{Mr} NORMAL{James b.}

or Msuperscript{e} BOLD{Jack Brown}

etc etc.

Any help would be appreciated.
 
G

Graham Mayor

The charformat switch applies the format applied to at least the first
character of the field - so you could apply the format to the whole field -
which in effect is what occurs. You cannot format only part of a field. You
would either have to use a combination of fields or use vba to convert the
field to text and format it as you require.

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

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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