FieldBarcodeIsBookmark Property

Gets or sets whether PostalAddress is the name of a bookmark.

Namespace:  Aspose.Words.Fields
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.7.0

Syntax

public bool IsBookmark { get; set; }

Property Value

Type: Boolean

Examples

Shows how to insert a BARCODE field and set its properties.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Use a document builder to insert a bookmark with a US postal code in it
builder.StartBookmark("BarcodeBookmark");
builder.Writeln("96801");
builder.EndBookmark("BarcodeBookmark");

builder.Writeln();

// Reference a US postal code directly
FieldBarcode field = (FieldBarcode)builder.InsertField(FieldType.FieldBarcode, true);
field.FacingIdentificationMark = "C";
field.PostalAddress = "96801";
field.IsUSPostalAddress = true;

Assert.AreEqual(" BARCODE  96801 \\f C \\u", field.GetFieldCode());

builder.Writeln();

// Reference a US postal code from a bookmark
field = (FieldBarcode)builder.InsertField(FieldType.FieldBarcode, true);
field.PostalAddress = "BarcodeBookmark";
field.IsBookmark = true;

Assert.AreEqual(" BARCODE  BarcodeBookmark \\b", field.GetFieldCode());

doc.UpdateFields();
doc.Save(ArtifactsDir + "Field.BARCODE.docx");

See Also