Home › Forums › General XMetaL Discussion › How to determine the end of the document? › Reply To: How to determine the end of the document?
Reply to: How to determine the end of the document?
May 4, 2010 at 6:07 pmI think we need a more information.
One way to get to the end the document using only Range is as follows. The Select() is added so you can see where you end up.
[code]rng = ActiveDocument.Range;
rng.MoveToDocumentStart();
rng.SelectContainerContents();
rng.Collapse(sqCollapseEnd);
rng.Select();[/code]
This gets you there as well:
[code]docNode = ActiveDocument.documentElement;
rng = ActiveDocument.Range;
rng.SelectAfterNode(docNode);
rng.Select();[/code]
Or this:
[code]rng = ActiveDocument.Range;
rng.MoveToDocumentEnd();
rng.Select();[/code]
There are probably many other ways. Are these even close to what you are doing?