Skip to content

Content control style properties not applied. #35

@agtenr

Description

@agtenr

I have a template that has a style applied in the Content Control Properties (Heading 1). However, when the text replacements are done, the styling is not there:
image

Edit in Word

image

After the replacement:

image

Code:

// Replace standard content controls
var engine = new DefaultOpenXmlTemplateEngine();
var data = new
{
    meeting = new
    {
        title = "ICT Overleg",
        when = "24 feb. 2024",
        where = "Meeting room: Zolder"
    }
};
using var template = new TemplateDocument(wordDoc);
var src = new VariableSource(JsonConvert.SerializeObject(data));
engine.ReplaceAll(template, src);

Environment

  • .NET6
  • Console Application

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions