gpt4 book ai didi

visual-studio-2012 - 使用 spire.doc 更改整个 Word 文档的字体样式和大小

转载 作者:行者123 更新时间:2023-12-03 21:39:06 26 4
gpt4 key购买 nike

谁能告诉如何使用 spire.doc 更改整个 word 应用程序的字体大小?
如何选择整个文本范围并更改字体大小和样式?

谁能帮帮我吗??

最佳答案

在 Vb .net 中:

Dim document As New Document()
document.LoadFromFile("test.html", FileFormat.Html, XHTMLValidationType.None)
For Each section As Section In document.Sections
For Each paragraph As Paragraph In section.Paragraphs
For Each docObject As DocumentObject In paragraph.ChildObjects
If docObject.DocumentObjectType = DocumentObjectType.TextRange Then
Dim text As TextRange = TryCast(docObject, TextRange)
text.CharacterFormat.FontName = "Calibri"
End If
Next docObject
Next paragraph
Next section
document.SaveToFile("HtmlFileToPDF.pdf", FileFormat.PDF)

关于visual-studio-2012 - 使用 spire.doc 更改整个 Word 文档的字体样式和大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29330924/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com