Skip to main content

Метод Comment::getText

Метод возвращает текст комментария, тип boost::optional<std::string>.

Пример​


Comments comments = document.getRange().getComments();
std::shared_ptr<Enumerator<Comment>> enumerator = comments.getEnumerator();
if (enumerator)
{
while (enumerator->isValid())
{
Comment comment = enumerator->getCurrent();
boost::optional<std::string> commentText = comment.getText();
if (commentText.has_value())
{
std::printf("Text: %s", commentText.get().c_str());
}
enumerator->goToNext();
}
}