Hi Muhammad,
Thank you for contacting Syncfusion support.
On analyzing the given sample, we found that the
Replace functionality is performed with save formatting(source) due to which the table font(destination) wasn’t considered. To preserve the table font in
Replace functionality, save formatting must be disabled. Please find the code example which illustrates the above behavior.
public WordDocument FindPlaceHolderAndInsertTable(WordDocument wrd, WTable table, string placeHolderName)
{
//Add the table to the text body part.
TextBodyPart bodyPart = new TextBodyPart(wrd);
bodyPart.BodyItems.Add(table);
//Replace the place holder text with the table.
wrd.Replace(placeHolderName, bodyPart, true, true, false);
return wrd;
} |
We have modified the sample which can be downloaded from following link.
Please let us know if you have any questions.
Regards,
Dilli babu.