

Similarly, if the user updates the content type column values in the SharePoint Foundation user interface, the new values are demoted into the document itself, as document properties.įor more information on working with the Open XML Formats, visit Open XML Scenarios. For documents stored in Microsoft SharePoint Foundation, these property values are promoted back to the document library, as column values, when the user updates them in the document. Value.The document properties a user enters through the document information panel are stored in specific sections of Open XML Formats files. Private Sub CreateDocumentPropertyTable()ĭim rng As Word.Range = Me.( _ To use this code, run it from the ThisAddIn class in your project. The following example shows the complete procedure. Tbl.Cell(3, 2).Range.Text = ((Office.DocumentProperties)(document.BuiltInDocumentProperties)) Tbl.Cell(2, 2).Range.Text = ((Office.DocumentProperties)(document.BuiltInDocumentProperties)) Insert the document properties into cells. (, 3, 2, ref missing, ref missing) įormat the table and apply a style. Word.Range rng = document.Range(ref start, ref end) Īdd the table to the document at the range. Set the range to the top of the document. Populate tables in a VSTO Add-in To create a table and populate it with document properties Insert document properties into cells. Insert a title for the table and paragraph marks. Private void CreateDocumentPropertyTable() (Range:=Me.Paragraphs.Item(2).Range, NumRows:=3, NumColumns:=2) ' Insert a title for the table and paragraph marks. Private Sub CreateDocumentPropertyTable()ĭim rng As Word.Range = Me.Range(Start:=0, End:=0) To use this code, run it from the ThisDocument class in your project. Tbl.Cell(3, 2).Range.Text = ((Office.DocumentProperties)(this.BuiltInDocumentProperties)) Tbl.Cell(2, 2).Range.Text = ((Office.DocumentProperties)(this.BuiltInDocumentProperties)) Tbl.Cell(1, 1).Range.Text = "Document Property" Cell(3, 2).Range.Text = CType(Me.BuiltInDocumentProperties, Office.DocumentProperties) _ Cell(2, 2).Range.Text = CType(Me.BuiltInDocumentProperties, Office.DocumentProperties) _ Cell(1, 1).Range.Text = "Document Property" With rngĪdd the table to the document at the range. Insert a title for the table and include paragraph marks. Word.Range rng = this.Range(ref start, ref end) Dim rng As Word.Range = Me.Range(Start:=0, End:=0) Populate tables in a document-level customization To create a table and populate it with document properties For more information, see Features available by Office application and project type.

The following example creates a Microsoft Office Word table at the top of the document and populates it with the properties of the host document.Īpplies to: The information in this topic applies to document-level projects and VSTO Add-in projects for Word.
