如何从程序动态输出文字到word,要求同行的两句有不同的字体,大小等?
非常急,能帮到的话,给分80!

解决方案 »

  1.   

    试试看
    Private Sub Command1_Click()
        Dim WordTemps As New Word.Application
        WordTemps.Documents.Add "d:\aa.doc", False
        
        WordTemps.Selection.TypeText Text:="阿斯蒂芬四大幅"
        WordTemps.Selection.HomeKey Unit:=wdLine, Extend:=wdExtend
        WordTemps.Selection.MoveRight Unit:=wdCharacter, Count:=1
        WordTemps.Selection.TypeText Text:="  呵呵"
        WordTemps.Selection.MoveLeft Unit:=wdCharacter, Count:=8, Extend:=wdExtend
        WordTemps.Selection.Font.Color = wdColorRed
        WordTemps.Selection.MoveRight Unit:=wdCharacter, Count:=1
        WordTemps.Visible = True
    End Sub
      

  2.   

    Private Sub Command1_Click()
        Dim WordTemps As New Word.Application
        WordTemps.Documents.Add "d:\aa.doc", False
        WordTemps.Visible = True
        wordtemps.selection.font.color=2
        WordTemps.Selection.TypeText "阿斯蒂芬四大幅"
        wordtemps.selection.font.color=5
        WordTemps.Selection.TypeText "aaaaaaaa"
        End Sub