Rich Text Content control turns into a plain text content after association using Word 2007 content control toolkit.

Topics: Developer Forum
Apr 23, 2009 at 2:57 PM
Rich Text Content control turns into a plain text content after association using Word 2007 content control toolkit.

Is this normal?
Apr 23, 2009 at 4:21 PM
If have notice this in the source code

// Broken right now because of O12/663921

What does this mean please?
Coordinator
Jan 4, 2010 at 9:12 PM

The comment is obsolete now (and should be removed), but at the time of development it was a reference to the behavior that Word will throw an exception if you try to bind a rich text control. This behavior is now documented in MSDN: "Creating a mapping for a rich-text content control causes a run-time error". This behavior is the reason why the toolkit turns rich text controls into plain text ones in the case of binding - which was meant to be a graceful degradation; my appologies for any confusion this has caused.

Sep 27, 2010 at 7:48 AM

According to s2.5.2.6 of ECMA 376, as found at [1],

If the parent structured document tag is of type rich text or document part gallery, then [the data binding] property shall be ignored.

So it makes sense for dbe to try to do graceful degradation.

But with Word 2007, it actually isn't necessary.  Word 2007 does in fact honour the binding on a rich text content control (contrary to the spec) - whether its one with an explicit w:richText element, or one with no type (which 2.5.2.25 says amounts to the same thing).

What you can't do with Word 2007 though, is invoke the SetMapping method - as documented on MSDN.

I don't know how Word 2010 behaves (yet...).

cheers .. Jason

[1] http://www.documentinteropinitiative.org/implnotes/ecma-376/199da0bc-436a-4aec-9f41-8107fd48ebf3.aspx

May 28, 2012 at 4:39 AM

I am experiencing the same thing in Word 2010. I could make a lot of use out of this tool if it would allow Rich Text binding, but without it won't be able to use it at all. I was wondering if there are any plans to fix this?

Coordinator
May 28, 2012 at 4:41 AM
This is a limitation of Word, not the CCT.

Thanks,
Matr

From: mal0cch10
Sent: 5/28/2012 11:39 AM
To: Matt Scott
Subject: Re: Rich Text Content control turns into a plain text content after association using Word 2007 conte... [dbe:54250]

From: mal0cch10

I am experiencing the same thing in Word 2010. I could make a lot of use out of this tool if it would allow Rich Text binding, but without it won't be able to use it at all. I was wondering if there are any plans to fix this?

May 28, 2012 at 5:07 AM
> I am experiencing the same thing in Word 2010. I could make a lot of use out
> of this tool if it would allow Rich Text binding, but without it won't be
> able to use it at all.

As Matt says, you can bind a rich text control. However, you can work
around this to some extent if you are prepared to 'resolve' the
bindings yourself.

I do this by using the content control tag to store the binding
information. See the OpenDoPE conventions web site for details.