none
How to find updatable date and time format in MS Word RRS feed

  • Question

  • Hi,

    I've a large document with formatted dates and times ('Insert' Tab>> Date & Time). Is there any method to search each Date & Time and then add Word comment for each?

    Thanks.


    .

    Tuesday, August 9, 2016 2:05 PM

Answers

  • For example:

    Sub CommentDates()
        Dim fld As Field
        Application.ScreenUpdating = False
        For Each fld In ActiveDocument.Fields
            If fld.Type = wdFieldDate Then
                ActiveDocument.Comments.Add Range:=fld.Result, Text:="Date/Time"
            End If
        Next fld
        Application.ScreenUpdating = True
    End Sub


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    • Marked as answer by Sam1085 Tuesday, August 9, 2016 2:57 PM
    Tuesday, August 9, 2016 2:47 PM

All replies

  • For example:

    Sub CommentDates()
        Dim fld As Field
        Application.ScreenUpdating = False
        For Each fld In ActiveDocument.Fields
            If fld.Type = wdFieldDate Then
                ActiveDocument.Comments.Add Range:=fld.Result, Text:="Date/Time"
            End If
        Next fld
        Application.ScreenUpdating = True
    End Sub


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    • Marked as answer by Sam1085 Tuesday, August 9, 2016 2:57 PM
    Tuesday, August 9, 2016 2:47 PM
  • Thanks Sir. That's exactly what i need to do.

    .

    Tuesday, August 9, 2016 2:57 PM