Aspose::Words::Font::get_StrikeThrough method

Font::get_StrikeThrough method

True if the font is formatted as strikethrough text.

bool Aspose::Words::Font::get_StrikeThrough()

Examples

Shows how to add a line strikethrough to text.

auto doc = MakeObject<Document>();
auto para = System::ExplicitCast<Paragraph>(doc->GetChild(NodeType::Paragraph, 0, true));

auto run = MakeObject<Run>(doc, u"Text with a single-line strikethrough.");
run->get_Font()->set_StrikeThrough(true);
para->AppendChild(run);

para = System::ExplicitCast<Paragraph>(para->get_ParentNode()->AppendChild(MakeObject<Paragraph>(doc)));

run = MakeObject<Run>(doc, u"Text with a double-line strikethrough.");
run->get_Font()->set_DoubleStrikeThrough(true);
para->AppendChild(run);

doc->Save(ArtifactsDir + u"Font.StrikeThrough.docx");

See Also