我正在使用Outlook Professional Plus 2010并尝试设置字体颜色。
有人可以提供线索吗?
Sub InsertText()
Dim sText As String
sText = "Myname" + Format(Now(), "mm/dd/yyyy") + ":"
On Error GoTo ErrHandler
If TypeName(ActiveWindow) = "Inspector" Then
If ActiveInspector.IsWordMail And ActiveInspector.EditorType = olEditorWord Then
Set oRng = ActiveInspector.WordEditor.Application.Selection.Range
With oRng
.Text = sText
.Font.Color = wdColorRed
.Font.Size = 11
.Collapse wdCollapseEnd
.Select
End With
'ActiveInspector.WordEditor.Application.Selection.TypeText sText
End If
End If
Exit Sub
ErrHandler:
Beep
End Sub
答案 0 :(得分:0)
@Sorceri - 使用RGB(255,0,0)或Outlook.OlColor.olColorRed。
这对我有用..不知道办公室VBA对象受产品限制..