Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Eric L Eric L is offline
external usenet poster
 
Posts: 2
Default DocVariable and font caracteristics question

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.


  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default DocVariable and font caracteristics question

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
Word MVP web site http://word.mvps.org



"Eric L" Eric wrote in message
...
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.




  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default DocVariable and font caracteristics question

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
Word MVP web site http://word.mvps.org



"Eric L" Eric wrote in message
...
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.




Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
DocVariable Paul Mailmerge 2 December 1st 09 07:55 PM
docvariable, template (.dot) Paul Mailmerge 2 October 7th 09 08:56 PM
Use DocVariable field to initiative numbering? Tom Mailmerge 25 December 12th 06 01:15 PM
Help with FIELD CODES: DOCVARIABLE!!! Wendy D Microsoft Word Help 2 August 16th 05 08:32 PM
Cannot printing DocVariable Field lubo Microsoft Word Help 1 April 9th 05 07:00 AM


All times are GMT +1. The time now is 04:40 AM.

Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"