Класс Range
Класс Range предоставляет доступ к диапазону документа. На рисунке изображена объектная модель классов, относящихся к работе с диапазонами.

Варианты получения диапазона для текстового документа
// диапазон всего документа
Range range = document.getRange();
// диапазон блока
boost::optional<Block> blockOpt = document.getBlocks().getBlock(0);
if (blockOpt.has_value())
{
Range firstBlockRange = blockOpt.get().getRange();
}
// диапазон секций
Sections sections = document.getSections();
std::shared_ptr<Enumerator<Section>> enumerator = sections.getEnumerator();
while (enumerator->isValid())
{
Section section = enumerator->getCurrent();
Range sectionRange = section.getRange();
enumerator->goToNext();
}
// диапазон комментариев
Comments comments = document.getRange().getComments();
std::shared_ptr<Enumerator<Comment>> enumerator = comments.getEnumerator();
while (enumerator->isValid())
{
Comment comment = enumerator->getCurrent();
Range commentRange = comment.getRange();
enumerator->goToNext();
}
// диапазон ячейки
boost::optional<Table> tableOpt = document.getBlocks().getTable(0);
if (tableOpt.has_value())
{
Cell cell = tableOpt.get().getCell("B2");
Range cellRange = cell.getRange();
}
// диапазон верхних колонтитулов
boost::optional<Block> blockOpt = document.getBlocks().getBlock(0);
if (blockOpt.has_value())
{
Section section = blockOpt.get().getSection();
HeadersFooters headers = section.getHeaders();
std::shared_ptr<Enumerator<HeaderFooter>> enumerator = headers.getEnumerator();
while (enumerator->isValid())
{
HeaderFooter header = enumerator->getCurrent();
Range headerRange = header.getRange();
enumerator->goToNext();
}
}
// диапазон отслеживаемых изменений
std::shared_ptr<Enumerator<TrackedChange>> enumerator = document.getRange().getTrackedChangesEnumerator();
while (enumerator->isValid())
{
TrackedChange trackedChange = enumerator->getCurrent();
Range commentRange = trackedChange.getRange();
enumerator->goToNext();
}