OpenXml Ranges Similar to Word Interop

Home Forums WordprocessingML OpenXml Ranges Similar to Word Interop

Tagged: 

This topic contains 7 replies, has 3 voices, and was last updated by  Manu_TR 7 years, 8 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #3603

    Manu_TR
    Participant

    Hello,

    Is there Ranges in Openxml similar to Word interop assemblies?if no, how do we get the starting and ending character positions in open xml.

    Any help would be appriciated.

    Thanks!

    #3624

    Xyo
    Participant

    No, there isn’t. OOXML only knows about runs, paragraphs etc. Most of the information needed to reconstruct it is in the XML, but there are some edge cases where the range info from the word application would differ.

    #3626

    Manu_TR
    Participant

    Is there a way to track all the character offsets in openxml?
    Thanks!

    #3631

    Eric White
    Keymaster

    Hi Manu,

    What exactly do you mean by character offsets? Are you speaking of the exact, precise character position in the document?

    #3644

    Manu_TR
    Participant

    yes, the way how the ranges in the word interop have the start and end offset.

    Regards,
    manu

    #3678

    Eric White
    Keymaster

    The exact precise position of characters in documents is an interesting question.

    I have done work in this area – I recently completed a new module in Open-Xml-PowerTools: WmlComparer.

    The work that I’ve done in this new module will definitely inform future Open-Xml-PowerTools development. If wanting to calculate exact offsets, the approach I took in WmlComparer is similar to the one I would take.

    Introducing WmlComparer, a Module in Open-Xml-PowerTools

    Given that we don’t have a way to calculate exact offsets right now, it might be good to take a step back and ask what you are attempting to do? What is your scenario? What user problem are you trying to solve? I may be able to recommend a different approach to solving your issue.

    Cheers, Eric

    #3681

    Manu_TR
    Participant

    problem statement : if I have to highlight a word in the document, i need the beginning offset and the end offset of that word to bookmark that element. so I was wondering how can i get the beginning and end offset of that particular word.

    THanks,
    Manu

    #3682

    Manu_TR
    Participant

    I see that interop facilitates the Range feature which contains the beginning and end offset.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.