Thanks for the information. I was able to get this far:
ITextEditP textEditHandler = eeh.GetITextEdit(); if (NULL != textEditHandler) { T_ITextPartIdPtrVector textPartIds; textEditHandler->GetTextPartIds(eeh, *ITextQueryOptions::CreateDefault(), textPartIds); for each (ITextPartIdPtr textPartId in textPartIds) { TextBlockPtr textBlock = textEditHandler->GetTextPart(eeh, *textPartId); TextBlockCR textBlockCR = *textBlock; RunRange runRange(textBlockCR);// Only const iteration is possible. for (RunIterator runIter = runRange.begin(); runIter != runRange.end(); ++runIter) { RunCP currentRun = runIter.ToCaret()->GetCurrentRunCP(); CharStreamP charStreamP = dynamic_cast<CharStreamP>((RunP)currentRun); // EdfCharStreamP edfCharStreamP = dynamic_cast<EdfCharStreamP>((RunP)currentRun); // part of CharStream (special case?) if (charStreamP) { wprintf(L"charStream\n"); if (edfCharStreamP) { wprintf(L"\t EDF fields\n"); } else { // Would like to get Start and End Carets of RunRange. RunRange has GetStartCaret() and GetEndCaret() // methods, but how to cast RunIterator to RunRange??? } } else wprintf(L"NOT CharStream\n"); count++; } }
but is it possible to call RunRange::GetStartCaret() and RunRange::GetEndCaret() methods from the RunIterator?
Bruce