【问题标题】:Changing font style and size of entire word document using spire.doc使用 spire.doc 更改整个 Word 文档的字体样式和大小
【发布时间】:2015-03-29 15:22:02
【问题描述】:

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

谁能帮帮我?

【问题讨论】:

    标签: visual-studio-2012 spire.doc


    【解决方案1】:

    在 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)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-08
      • 1970-01-01
      • 2013-10-10
      • 2013-08-20
      相关资源
      最近更新 更多