Home › Forums › General XMetaL Discussion › MoveToElement() Help › Reply To: MoveToElement() Help
Reply to: MoveToElement() Help
December 2, 2014 at 7:13 pmI don't see any issues with the API, so I guess there's probably an issue with your logic.
Here's a simplified script you can test with that uses the API in a similar way to return all the element names by moving a Range:
[code]//XMetaL Script Language JScript:
var rng = ActiveDocument.Range;
rng.MoveToDocumentStart();
while(rng.MoveToElement()) {
Application.Alert(rng.ContainerName);
}[/code]