Reply to: xmetal selection ReadonlyContainer valueOctober 15, 2013 at 8:24 pm
Having no idea what your document structures look like it is difficult to give the best answer.
However, if there is only one
//XMetaL Script Language JScript:
var rng = ActiveDocument.Range;
rng.ReadOnlyContainer = true;
rng.NonRemovableContainer = true;
You say “the reference to the selection will change”. I'm not sure what you mean by that, but it sounds like maybe that is your issue. There is only ever one Selection object in a document, set by the user and possibly manipulated using script. Generally scripts use Range instead as you can have multiple Range objects, they are invisible, and they can go some places that a Selection cannot.