I have a VB.Net app that creates a Word Document (VSTO). The document will contain Custom Properties, and insert those Custom Properties into the document. I have the creation of the Custom Properties (being read from Cells in a DataGridViewRow (dgvrStudent): docCurrent = appWord.Documents.Add With docCurrent Dim docProperties As Microsoft.Office.Core.DocumentProperties docProperties = .CustomDocumentProperties docProperties.Add($"BM_SpecialFL", False, Microsoft.Office.Core.MsoDocProperties.msoPropertyTypeBoolean, dgvrStudent.Cells("dgvStudents_SpecialFL").Value) and the inserting of the properties: Dim rngHeader As Word.Range = wrdSection.Headers(Word.WdHeaderFooterIndex.wdHeaderFooterFirstPage).Range Dim paraHeader As Word.Paragraph paraHeader = rngHeader.Paragraphs.Add paraHeader.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter paraHeader.Range.Font.Name = "Times New Roman" paraHeader.Range.Font.Size = 12 paraHeader.Range.Font.Bold = False paraHeader.Range.Font.Italic = True paraHeader.Range.Font.Color = Word.WdColor.wdColorDarkBlue paraHeader.Range.Fields.Add(paraHeader.Range, Word.WdFieldType.wdFieldDocProperty, "BM_Special") The other Custom Properties are simply inserted using the WdFieldTYpe.wdFieldDocProperty command, however the field above needs to be part of the "=IF" formula: { IF {DocProperty BM_SpecialFL * MERGEFORMAT } = "Y" "Special¶" "" * MERGEFORMAT } via: paraHeader.Range.Fields.Add(paraHeader.Range, Word.WdFieldType.wdFieldFormula = "IF {DocProperty BM_SpecialFL * MERGEFORMAT } = "Y" "Special¶" "" * MERGEFORMAT" but I don’t know how to insert the {DocProperty BM_SpecialFL} into the string. The result in the Document is: if the Custom Property BM_SpecialFL is True, then the literal is displayed followed by a paragraph break: so that the literal "Special" appears on a line by itself, but if the Property is False, then nothing is displayed and no paragraph break occurs. Is there any way of doing this? Thanks for your time in advance. Sincerely, Paul Goldstein