Results 1 to 9 of 9

Thread: Code to put Date & Time at the bottom of a user Contact form in OL 2010

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    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
    Last edited by Aussiebear; 01-13-2025 at 12:34 PM.
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •