xxx.font.color=rgb(intR,intG,intB)

解决方案 »

  1.   

    cdlg是一个commanddialog控件Private Sub Command1_Click()
    Dim mApp As Word.Application
    Dim mDoc As Word.Document
    Set mApp = New Word.Application
    mApp.Visible = True
    Set mDoc = mApp.Documents.Add
    cdlg.ShowColor'---------------------------------    Selection.TypeText Text:="~!·~#·#!·¥3"
        Selection.MoveLeft Unit:=wdCharacter, Count:=9, Extend:=wdExtend
        With Selection.Font
            .NameFarEast = "宋体"
            .NameAscii = "Times New Roman"
            .NameOther = "Times New Roman"
            .Name = "Times New Roman"
            .Size = 10.5
            .Bold = False
            .Italic = False
            .Underline = wdUnderlineNone
            .UnderlineColor = wdColorAutomatic
            .Strikethrough = False
            .DoubleStrikeThrough = False
            .Outline = False
            .Emboss = False
            .Shadow = False
            .Hidden = False
            .SmallCaps = False
            .AllCaps = False
            .Color = cdlg.Color
            .Engrave = False
            .Superscript = False
            .Subscript = False
            .Spacing = 0
            .Scaling = 100
            .Position = 0
            .Kerning = 1
            .Animation = wdAnimationNone
            .DisableCharacterSpaceGrid = False
            .EmphasisMark = wdEmphasisMarkNone
        End With
    '-----------------------------------
    End Sub