首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用spire.doc更改整个word文档的字体和大小

使用spire.doc更改整个word文档的字体和大小
EN

Stack Overflow用户
提问于 2015-03-29 23:22:03
回答 1查看 597关注 0票数 4

谁能告诉我如何使用spire.doc更改整个word应用程序的字体大小?

如何选择整个文本范围并更改字体大小和样式?

有人能帮帮我吗??

EN

回答 1

Stack Overflow用户

发布于 2021-02-03 17:08:26

在Vb .net中:

代码语言:javascript
复制
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)
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29330924

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档