View Single Post
  #3   Report Post  
Posted to microsoft.public.word.formatting.longdocs,microsoft.public.word.docmanagement
Jose Valdes Jose Valdes is offline
external usenet poster
 
Posts: 27
Default \* MERGEFORMAT and \* Charformat

Graham,

I am sorry that I did not provide enough information for you. I spent
considerable time trying to provide enough information without turning this
message into a book. Hopefully, I'll do better this time around. ;-)

I also avoid using MergeFormat and CharFormat unless necessary, and in this
case it is absolutely necessary. When you update a REF field that uses
neither switch, it drops all direct formatting and character styles, but it
assumes the formatting of the paragraph style. In this case, I am using a
character style to hide some content, and another character style to show
some other content. If the REF field does not retain the character style,
text that I want to hide might be visible.

Here are the steps to recreate the problem with \* CharFormat
-Create a new character style.
-Add the \* CharFormat switch to a REF field
-Apply character style to the 'R' in REF field.
-Modify character style to be hidden text.
-Update the REF field

If you have successfully recreated the problem the REF field will be visible
instead of invisible. Like all truly perplexing problems, this one only
appears when it can cause me the most pain. I won't be surprised if you come
back with the standard Microsoft answer, "It works when I try it". ;-)

Here are the steps to recreate the \* MergeFormat problem:
-Create a new character style.
-Modify character style to be hidden text.
-Apply the character style to a REF field that displays the text of a
bookmark.
-MS Word automatically applies the MergeFormat switch to the REF field (if
it didn't have it already)
-The REF field disappears.
-Change the value of the bookmark (used by REF) to be something
significantly longer than its original value such as going from "Product" to
"Product Information Regarding Useless Warnings"
-Update the REF field.

If you have successfully recreated the problem, the first half of the REF
field is hidden, but the second half is visible.

By the way, if no one has a solution to these bizarre problems, I won't
fault the expert knowledge of this very helpful community. Some problems are
just too weird for even the smartest of newsgroups. ;-)
I have resigned myself to creating a VBA script that will reformat these
nasty REF fields before going to print.

Thanks!
Jose

"Graham Mayor" wrote in message
...
Personally I don't use Mergeformat at all. Either I use no switch and
format the field as required or add a charformat switch if needed.
You haven't provided sufficient information to duplicate the conditions at
your end, but from your description it appears that the field is not
updating. You may be better employed adding a macro to force an update -
Try the sample code at http://www.gmayor.com/installing_macro.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Jose Valdes wrote:
The following format switches are giving me inconsistent results in
MS Word 2003: \* MERGEFORMAT and \* Charformat.

I use two character styles, 2400 and 3000, based on product model
numbers to hide and show text. For example, if I print the 2400
manual, I format the 3000 character style as hidden text. The problem
is that if I apply a character style to a cross-reference (ref
field), the ref does not consistently keep the character style when
the result of the field changes. For example, if the result of the
ref is "Product", only part of the result of the ref field keeps the
character style when it changes to something longer like "Product
Information". Maybe the word Product will keep the character style,
but Information will not.
Another annoyance of Charformat is that if I change which character
style is hidden and which is shown, some ref fields lose the
character style. I know that I have seen this problem with
Charformat, but I'm not sure about MERGEFORMAT.

Does anyone know how to get one or both of these format switches to
work properly? I feel like I am using these switches exactly as they
are documented by Microsoft.

Currently, I use MERGEFORMAT exclusively and I re-apply character
styles to ref fields when they change their values. Unless I can get
these switches to work properly, I plan to write a VBA script that
will automate re-applying these formats.
Thanks! Jose