Back to Devexpress

Field.Unlink() Method

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-field-3b66463c.md

latest2.1 KB
Original Source

Field.Unlink() Method

Replaces the field with the field value.

Namespace : DevExpress.XtraRichEdit.API.Native

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
void Unlink()
vb
Sub Unlink

Remarks

The Unlink method converts the field result to text or graphics. Unlinked fields cannot be updated.

Use the FieldCollection.Unlink method to unlink all fields in specific parts of a document (main body, text box, header, footer, comment, footnote, and endnote). The Document.UnlinkAllFields method allows you to unlink all fields in the document.

The code sample below unlinks the first field in the main document body.

csharp
using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;
//...

using (RichEditDocumentServer wordProcessor = new RichEditDocumentServer())
{
    // Access a document.
    Document document = wordProcessor.Document;
    //...
    // Unlink a field.
    document.Fields[0].Unlink();
}
vb
Imports DevExpress.XtraRichEdit
Imports DevExpress.XtraRichEdit.API.Native
'...

Using wordProcessor As New RichEditDocumentServer()
  ' Access a document.
  Dim document As Document = wordProcessor.Document
  '...
  ' Unlink a field. 
  document.Fields(0).Unlink()
End Using

See Also

Field Interface

Field Members

DevExpress.XtraRichEdit.API.Native Namespace