field formatting

C

cayce

How can I force a DocProperty field to take on the font type, size, and color
formatting of the paragraph that it is in? (Sometimes part of the field’s
text is one font/size color and the remaining field text is another font
size/color). What I also want is for the text to display capitalization as
the User typed it in the input box they get when running the macro.

I am just getting a little familiar with VB code and would appreciate
guidance in these uncharted waters.

Thanks
 
P

Peter Jamieson

Broadly speaking
a. remove, or do not insert, the \*Mergeformat switch. This is the
so-called "preserve formatting" switch, but its behaviour is unlikely to
help in many situations
b. if necessary, use the \*Charformat switch, which makes the field
result take on the formatting of the first character of the field code -
i.e. you are probably OK to format the entire field code with the
surrounding format, and include \*charformat
c. if the user typed something in in mixed case, leave it as it is and
avoid applying font formatting such as smallcaps to the field.
d. your code can format either the field codee, or the field result,
or both. You may find that you need to do different things in different
circumstances, but in most cases formatting the field code and applying
\*charfomat should do the trick.

Peter Jamieson

http://tips.pjmsn.me.uk
 

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