Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.
Fri Aug 11, 2023 2:11 am
文字上下标
Login to view the files attached to this post.
-

yabozhao
-
- Posts: 26
- Joined: Sat Jul 22, 2023 1:44 am
Fri Aug 11, 2023 5:35 am
您好,
感谢您的咨询。
请使用下面的代码实现给您附件中给文本添加上标的需求:
- Code: Select all
Document doc = new Document();
Section sec = doc.AddSection();
Paragraph para = sec.AddParagraph();
para.AppendText("测试");
para.AppendText("111").CharacterFormat.SubSuperScript = SubSuperScript.SuperScript;//111作为上标
doc.SaveToFile("F:\\result.docx", FileFormat.Docx);
Spire.Doc中更多关于word文档上下标的使用,您可以参考下面的链接:
https://www.e-iceblue.cn/text/insert-superscript-and-subscript-in-word.htmlSincerely
Wenly
E-iceblue support team
-


Wenly.Zhang
-
- Posts: 149
- Joined: Tue May 16, 2023 2:19 am