How access the TextPointerContext.ElementStart element?

Answered How access the TextPointerContext.ElementStart element?

  • Tuesday, August 21, 2012 8:34 PM
     
     

    TextPointer.GetPointerContext returns a TextPointerContext enum. One of the values is ElementStart. Another is Text. To get the contents of PointerContext = Text you use GetTextInRun. How do you get the TextElement that forms the ElementStart/ElementEnd context pointed to by a TextPointer?

    thanks,

All Replies

  • Tuesday, August 21, 2012 9:09 PM
     
     Answered

    TextPointer.GetAdjacentElement is what I am looking for.  Am thinking that when extracting all the text of a line I can run a GetPointerContext loop that stops when the ElementStart element is a LineBreak.

    • Marked As Answer by Steve Richter Tuesday, August 21, 2012 9:10 PM
    •  
  • Wednesday, August 22, 2012 7:28 AM
    Moderator
     
     

    Hi Steve Richter,

    Glad to hear that you have resolved your issue.

    Best regards,


    Sheldon _Xiao[MSFT]
    MSDN Community Support | Feedback to us
    Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.