Get Started
Documentation

SetItalic

SetItalic(isItalic)

Inherited From:

Set the italic property to the text character.

Parameters:

Name Type Description
isItalic boolean Specifies that the contents of the current run are displayed italicized.

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph, oRun;
oParagraph = oDocument.GetElement(0);
oRun = Api.CreateRun();
oRun.AddText("This is just a sample text. ");
oParagraph.AddElement(oRun);
oRun = Api.CreateRun();
oRun.SetItalic(true);
oRun.AddText("This is a text run with the font set to italicized letters.");
oParagraph.AddElement(oRun);
builder.SaveFile("docx", "SetItalic.docx");
builder.CloseFile();

Resulting document