Replace condition format
Hi experts,
I want to replace a condition format A by format B.
The current TR contains format A (but of course may also contain other condition formats, such as C).
The following code works only partially:
ApplyCondFmt = function (oDoc, oTR, sFormat) { /* =========================
Arguments oDoc Document to be handled
oTR Text range to receive the new format
sFormat Name of Conditon format (was selected from catalogue)
Reference http://frameautomation.com/category/extendscript/page/3/
*/
var oCondFmt, oProps, iPropIndex;
oCondFmt = oDoc.GetNamedCondFmt(sFormat);
if(!oCondFmt.ObjectValid()) return; // emergency exit
oProps = oDoc.GetTextPropVal (oTR.beg, Constants.FP_InCond);
oProps.propVal.osval[0] = oCondFmt; // new format
oDoc.SetTextPropVal (oTR, oProps); // seems to do nothing
} // --- end ApplyCondFmt ------------------------------------------------
And of course I have no idea how to replace the format if there is more than one entry in osval ...

