I assumed that you had already declared what 'Item' was You have to tell they macro what 'Item' is e.g.
Public Sub DateRed() Dim Item As Object Dim olInsp As Outlook.Inspector Dim wdDoc As Object Dim oRng As Object Set Item = ActiveExplorer.Selection.Item(1) If TypeName(Item) = "ContactItem" Then With Item .Display Set olInsp = .GetInspector Set wdDoc = olInsp.WordEditor Set oRng = wdDoc.Range oRng.collapse 0 oRng.Text = vbCr & Date & " - " & FormatDateTime(Time, 4) & ": " oRng.Font.Color = &HFF oRng.collapse 0 oRng.Select End With Else Beep End If End Sub




Reply With Quote