We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Read Address Block Field

Hi Team,

I need sample code snippet in Java to read the address block merge field, if possible.

This message was posted using Email2Forum by Babar Raza.

Hi Irina,

Can you please also attach your sample document for reference and to clearly understand the requirement?

Best Regards,

Hi Muhammad,

I attached the file. Thank you for your help.

Hi Irina,

You can use the following code.

Document doc = new Document("AddressBlockField.docx");
for (Field field : doc.getRange().getFields())
{
    if (field.getType() == FieldType.FIELD_ADDRESS_BLOCK)
    {
        System.out.print(field.getFieldCode());
        break;
    }
}

Best Regards,