none
Question about the use of _Document.DocID Property in Microsoft.Office.Interop.Word RRS feed

  • Question

  • I have a question about the purpose of the _Document.DocID property in Interop 14. 

    msdn.microsoft.com/en-us/library/microsoft.office.interop.word._document.docid.aspx

    I've inherited some code for a Word plugin that was develop for Word 2010, and it uses this property throughout.  I've been asked to convert this plugin to be used in Word 2007, and from what I can tell the DocID is an undocumented feature.

    Can anyone shed some light on what the value that is being returned represents?  And does anyone know how to get this value using Word 2007?

    Thanks.

    Jason

    Friday, November 9, 2012 8:50 PM

Answers

  • Hi Jason

    Reading the page to which you linked I observe that the only remark about the property is "Reserved for internal use only."

    What's more, the intention is that programmers use the DocumentClass, not the _Document Interface. This is visible due to the way the COM type libraries are "converted" to PIAs, but that doesn't mean that everything that is exposed in this way is meant to be used...

    It appears that Word 2007 (and earlier) versions do not have a DocId property.

    I believe you'll have to analyze how the property is being used in the code you inherited and describe that to us. You'll need to devise a different approach for 2007 and, given that the use of this property is unsupported, it may perhaps be wise to change the 2010 code, as well.


    Cindy Meister, VSTO/Word MVP, my blog

    Saturday, November 10, 2012 7:37 AM
    Moderator

All replies

  • Hi Jason

    Reading the page to which you linked I observe that the only remark about the property is "Reserved for internal use only."

    What's more, the intention is that programmers use the DocumentClass, not the _Document Interface. This is visible due to the way the COM type libraries are "converted" to PIAs, but that doesn't mean that everything that is exposed in this way is meant to be used...

    It appears that Word 2007 (and earlier) versions do not have a DocId property.

    I believe you'll have to analyze how the property is being used in the code you inherited and describe that to us. You'll need to devise a different approach for 2007 and, given that the use of this property is unsupported, it may perhaps be wise to change the 2010 code, as well.


    Cindy Meister, VSTO/Word MVP, my blog

    Saturday, November 10, 2012 7:37 AM
    Moderator
  • Just for clarification DocumentClass is for internal use only. The _Document interfaces is recommended for use by Microsoft. 


    Mohamed Salti

    Wednesday, November 14, 2012 9:40 PM