Font style on insert merge field into document

Hello

I am trying to insert a mail merge field into a document.  I can do this, but when the field is inserted it seems to be inserted as Font Style "Calibri Light" size 10 when the paragraphs around it are Calibri, size 12.

I have attached a sample:

- Goto Document Editor and wait for the document to load
- Place cursor under merge field <<CompanyAddress3>>
- Press button "Insert Field"

You will see this:




I know I can probably apply a style to the field, but really I would like it to adopt the Font Style and size of the preceding paragraph.

Any ideas?

Thanks 











Attachment: SyncfusionTroubleshoot_69292bce.zip

2 Replies 1 reply marked as answer

SM Suriya Murugan Syncfusion Team April 8, 2021 07:24 AM UTC

Hi Richard, 

Syncfusion Greetings! 

We have checked the provided sample you are trying to insertField by creating new paragraph. 

If your requirement is to insertMergeField, you can use below code snippet: 

SfDocumentEditor editor = container.DocumentEditor; 
        editor.Editor.InsertField("MERGEFIELD  Hello  \\* MERGEFORMAT "); 


It will insert the field at current selection. 

If not, kindly share your exact requirement and we will share the solution based on that. 

Please let us know if you have any questions. 

Regards, 
Suriya M.  


Marked as answer

DI Ditchford April 12, 2021 05:57 AM UTC

Hey


Thanks, that is so much easier.

Regards

Loader.
Up arrow icon