View Single Post
 
Old 12-22-2015, 01:54 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

What you are trying to achieve is not possible. Outlook templates do not store macros and while the Outlook editor is Word based it is only superficially like Word. If it was for your own use, you could add a macro to Outlook to enter or change the date in the message body, but you couldn't transport it with the template for other users.

If that will suffice then the following macro in your ThisOutlookSession folder will update and fix the date field (if present) when you click 'Send' for all messages.
Code:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim olInsp As Inspector
Dim wdDoc As Object
Dim orng As Object
Dim ofld As Object
    With Item
        Set olInsp = .GetInspector
        Set wdDoc = olInsp.WordEditor
        Set orng = wdDoc.Range
        For Each ofld In orng.Fields
            If ofld.Type = 31 Then
                ofld.Update
                ofld.Unlink
            End If
        Next ofld
        .Display
        .Save
    End With
lbl_Exit
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote