track changes issue for styleRef in Header while protection is ON

R

Ryan G

Hi everyone,

Having some issues where every revision generates a new value for the the
styleref

here are the relevant info:
- we have a StyleRef field in the document Header (say { STYLEREF "Heading
1" } or that with (\* MERGEFORMAT) will still yield the same issue)
- a text (ie. Test) with style = Heading 1
- a bookmark wrapping the text above (Test)

i) turn protection on but sets the bookmark range as editable (usually
indicated by a yellow highlight)
ii) have some codes to turn track changes on after turning protection ON
(using C#-VSTO or VBA - either of which would still produce the issue)

Set focus to the bookmark and made some changes. Notice that for every
change/keystroke in the reference text, a new value is generated in
associated Header field.

Normally, track changes button and menu item is disabled once protection is
off that suggests that working with track changes while protection is
something fishy but as Word allows conditional protection it should not have
been a problem.

I was thinking of using Locked property of the styleref field but it has
another issue of ignoring the strikethroughs when the field value is updated.

Your comments would be very much helpful and appreciated.

Ryan
 
Z

zkid

I think we're a little shaky on what exactly you mean by "generates a new
value." Can you describe the problem a bit more?
 
S

saint

zkid,

thanks for spending time to look into this.
here are a few more details (I always reproduce this with steps in my
original post and if ever you decide to try too, i hope you see get it too) :

say style referenced value is originally ABC
i changed this to ABCDEF
since track changes is on, DEF will appear inserted (with a different color)

however the field (styleref) in the header referencing this value will be
ABCDEFABCDEABCDABC

or a concatenation of ABCDEF, ABCDE, ABCD, ABC (this last one will have
strikethrough). Hope that explains a little more
 
Z

zkid

I think I understand a bit better. What happens if you change \* MERGEFORMAT
to \* CHARFORMAT?
 

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