You are not allowed to edit this selection because it is protected

D

David Thielen

I think I figured out what is causing this - but still need help to
fix. Create 3 content controls in a row. Then delete the middle one
and insert a drawing at that location. That causes this error.

When I do this, I take the range from the deleted content control and
create a range where the Start & End is set to the Start of the range
of the content control just deleted. Clearly that is wrong.

How do I get the range of the spot between what is now 2 content
controls to insert a drawing at?

thanks - dave


Hi;

I am getting the COMException "You are not allowed to edit this
selection because it is protected" when I call InsertXML with the
OpenXML for a drawing object in a cell of a table - sometimes.

Any idea why? And what do I do to work around this?

thanks - dave

david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm


david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
J

Ji Zhou

Hello Dave,

I think we can use the first ContentControl.Range.End+1 with the second
ContentControl.Range.Start-1 to construct a range. Then we can do the
InsertXML on that range object.

Does this work for your scenario?


Best regards,
Ji Zhou - MSFT
Microsoft Online Community Support
 
D

David Thielen

That works - need the -1 for fields too. But it does scare me to just
blindly subtract 1.

thanks - dave


Hello Dave,

I think we can use the first ContentControl.Range.End+1 with the second
ContentControl.Range.Start-1 to construct a range. Then we can do the
InsertXML on that range object.

Does this work for your scenario?


Best regards,
Ji Zhou - MSFT
Microsoft Online Community Support


david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
J

Ji Zhou

It is not blindly to subtract 1. As we discussed in another thread
"ContentControl.Range.ContentControls.Count returns 0", the
ContentControl.Range represents the inner contents of the content control.
So if we want to get a range which contains the content control, we use
Range(ContentControl.Range.Start-1, ContentControl.Range.End+1).

Based on this, it would not be difficult to understand why we use the first
ContentControl.Range.End+1 with the second ContentControl.Range.Start-1 to
construct a range here.


Best regards,
Ji Zhou - MSFT
Microsoft Online Community Support
 

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