none
Word 2010 rich text content control shape RRS feed

  • Question

  • Hi all,

    I am developing an app-level addin for Word, originaly for Word 2007 + .net 3.5, recently I updated the project to target Word 2010 + .net 4 Client Profile.

    In Word 2007 when adding rich text content controls, they always had nice rectangular shape, regardless of text alignment, now in Word 2010 they have irregular ugly shape when text alignment is set to justified (the content control gets somewhat extended in lines formatted to block with no paragraph mark).

    I would very much appreciate any help on how to achieve regular rectangular shape of word content controls. Thanks in advance.

    Monday, January 28, 2013 10:49 PM

Answers

  • Hi, please find the solution here:

    social.technet.microsoft.com/Forums/en-US/officeitproprevious/thread/24c14b49-9d65-4bca-a805-6e787c497314/?prof=required

    • Marked as answer by Peter Bernik Friday, February 1, 2013 12:31 PM
    Friday, February 1, 2013 12:31 PM

All replies

  • Hi Peter

    This question belongs more in the end-user category, but as far as I know, there's absolutely no way to change how the "shape" of the content control is displayed when the focus is inside a content control. "It is what it is".


    Cindy Meister, VSTO/Word MVP, my blog

    Tuesday, January 29, 2013 8:49 AM
    Moderator
  • Hi Cindy, thanks indeed for the instant answer.

    You are right that this is actually not a programming issue - the result seems to be the same whether the content control is being added programmatically or via the Word UI. Iĺl try to repost it to another forum.

    However there must be some trick how to achieve that the content control would be added and later displayed as rectangle, I experienced this in 2007 sometimes and then suddenly it was gone. If it can show nicely in 2007 then I am sure it must show the same in 2010.

    I would be thankful If some of you could give me a feedback on how the rich text content control is displayed If you select a range including few paragraphs in a document which has alignment set to "justified"and than add a richtextcontentcontrol.

    If there is a way to make the content control look rectangular, I have to find out, as this shape is really terrible.

    THANKS IN ADVANCE!!!

    Tuesday, January 29, 2013 9:23 AM
  • Hi Peter

    Probably what you're seeing is the way Word is handling spaces? Spaces at the end of a line ("trailing spaces") aren't included in how the page width is calculated - this would make a ragged edge. But they're still contained in the content control, so the right side of the content control expands as necessary to include them. Turn on the display of non-printing characters (the backwards "P" in the Home tab) and you'll see this. If someone typed more than one space at the end of a line, the border will extend to include that, which could give a ragged appearance.

    Better place to ask:
      http://answers.microsoft.com/en-us/office/forum/word

    FWIW, if anything controls it, it would probably be in File/Options/Advanced/Layout. However, I just tried a few of the more likely options and there was no change.


    Cindy Meister, VSTO/Word MVP, my blog

    Tuesday, January 29, 2013 11:10 AM
    Moderator
  • Exactly. However, there´s no need to type more than one space - a single space at the end of the line is enough to cause this effect. I´ll try to play with the layout options and see what happens. Thanks for the moment.
    Wednesday, January 30, 2013 8:26 PM
  • Hi Peter

    <<a single space at the end of the line is enough to cause this effect>>

    Yes, but with a single space at the end of every line (which would be the norm) the effect isn't so "ragged". In cases where there are a variable number of spaces, it would be quite "distracting".

    If you don't make any progress, I recommend the other website as this is really an end-user question and you'll find a lot more people there, than here, who will be using Word rather than "just" programming against its APIs.


    Cindy Meister, VSTO/Word MVP, my blog

    Thursday, January 31, 2013 7:39 AM
    Moderator
  • That is correct, If every line ends with a single space, everything is ok, however usually the last line of the section ends with a paragraph mark, which always causes the difference in the content control width.

    So I have to find out how to make Word either ignore the last space in every line when calculating width of the content control or to simulate maximum page width in lines ended with paragraph marks.

    I reposted the question to suggested forum and to another one. Thank you!

    Thursday, January 31, 2013 7:52 AM
  • Hi, please find the solution here:

    social.technet.microsoft.com/Forums/en-US/officeitproprevious/thread/24c14b49-9d65-4bca-a805-6e787c497314/?prof=required

    • Marked as answer by Peter Bernik Friday, February 1, 2013 12:31 PM
    Friday, February 1, 2013 12:31 PM