Hello,
When opening XML in FM, sometimes, FM can't apply correctly the EDD to my document.
Example on a book of 1.500 pages there can be around 20 superscript text that are display as normal normal text.
The only way i found is to forced FM to apply the EDD correctly by forcing him with Searching&replacing the <sup> element.
Or faster, replace the HighestLevelElement on each chapter (element call <CHAPTER>)
Would like to do it with a script (so i can add it to my open book script ... there are around 10 script at the opening of a book
I can select all the doc, get the HighestLevelElement name, can delete it or warp an element around it but can't replace the element by it self?
var vCurrentDoc= app.ActiveDoc; var vFlow = vCurrentDoc.MainFlowInDoc; var vPgf = vFlow.LastTextFrameInFlow; var vFirstPgf = vFlow.FirstTextFrameInFlow; var textRange = new TextRange(); textRange.beg.obj = vFirstPgf; textRange.beg.offset = 0; textRange.end.obj = vPgf; textRange.end.offset = Constants.FTI_PgfEnd; vCurrentDoc.TextSelection = textRange; var vElement = vFlow.HighestLevelElement; var vElemDef = vElement.ElementDef; var vReplaceElem = vCurrentDoc.GetNamedElementDef(vElemDef.Name); // vReplaceElem.Delete() or WarpElement();
So how to eaplce an existing element by itself?