Word VSTO - Why paraId is sometimes missing

前端 未结 1 435
攒了一身酷
攒了一身酷 2021-01-28 09:02

I\'m retrieving paragraph stylenames from openXML and using paraID property to get the right one.

During testing i noticed that depending on the word document the attrib

相关标签:
1条回答
  • 2021-01-28 09:32

    From the Word Language Reference for Paragraph.ID:

    Returns or sets the identifying label for the specified object when the current document is saved as a Web page.

    Since the document is not saved as HTML the property has no meaning.

    The ParaId property is not exposed for developers to use. It's not visible in the VBA object model, but due to the way the PIA (primary interop assemblies) are generated the .NET developer will see it. From the language reference:

    Reserved for internal use.

    Not sure what it is you're really trying to do, but you can use Word's Range.Find capability to search formatting (styles).

    0 讨论(0)
提交回复
热议问题