View Single Post
 
Old 11-14-2013, 01:12 AM
BrainSlugs83's Avatar
BrainSlugs83 BrainSlugs83 is offline Windows 7 64bit Office 2010 32bit
Novice
 
Join Date: Oct 2013
Location: Kirkland, WA
Posts: 5
BrainSlugs83 is on a distinguished road
Default

Hey, thanks for the response! Sorry on getting back so late. I've just been super busy and have put this issue on the back burner until now.

I was unaware of this requirement about content controls requiring empty paragraphs in them. Again, you can delete the trailing paragraph from within Word's UI (I posted the steps above). At any rate, allowed or not -- Word doesn't prevent users from doing it, so I have to account for it.

As for the approach, it gets me a bit further, but there's still some circumstances where it doesn't work quite right -- for example, if the content control is a child content control of a parent, and it happens to be the very last piece of content in the parent (i.e. the parent can contain tables, other content controls, paragraphs, etc., etc. but there is zero content after the final child control)...

In this situation, calling nothing but ".ConvertToText" does almost exactly what it should -- it converts the Table to text, but it moves the child control outside of the parent.

I suppose I can detect this watching for a change in "cc.ParentContentControl" -- but then I'd have to undo it (what if I'm in the middle of an UndoRecord, I don't want to undo the whole thing...) -- and also, I have to figure out a way to prevent the removal of the content control... put a paragraph after it, somehow, seems to do the trick... ugh, it just gets super hairy from there. :-/
Reply With Quote