Keep word from inserting current date in a previously written mem.

  • Thread starter Retaining Original Memo Date
  • Start date
R

Retaining Original Memo Date

When a user opens a previously written memo - Word inserts the current date
in the date field. How do we turn this off.
 
S

Stefan Blom

Press Alt+F9 to show field codes. Change the DATE (or TIME) part of the
field to CREATEDATE. Press F9 to update. Press Alt+F9 again to hide field
codes.

--
Stefan Blom
Microsoft Word MVP



"Retaining Original Memo Date" <Retaining Original Memo
(e-mail address removed)> wrote in message
news:[email protected]...
 
J

JRG

This seems to fix the automatic change to the "open" document, but doesn't
keep Word from changing the date when this document is closed and a new,
previously saved, document is opened (I'm currently using Word 2007). Is
there a "global" fix so we don't have to use CREATEDATE in every
previously-saved document to retain the original date?
 
S

Suzanne S. Barnhill

Well, for starters, change the field in your template to CREATEDATE. This
will solve the problem in newly created documents. There is no shortcut for
existing ones, though.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 
G

Graham Mayor

Having made the change in the document template for new documents, you will
have either open each existing document and change it manually or use a
macro to change the date fields in all the documents in a particular folder
using a macro such as:

Sub BatchFixDates()
Dim strFile As String
Dim strPath As String
Dim oDoc As Document
Dim iFld As Integer
Dim fDialog As FileDialog
Set fDialog = Application.FileDialog(msoFileDialogFolderPicker)

With fDialog
.Title = "Select Folder containing the documents to be modifed and click
OK"
.AllowMultiSelect = False
.InitialView = msoFileDialogViewList
If .Show <> -1 Then
MsgBox "Cancelled By User"
Exit Sub
End If
strPath = fDialog.SelectedItems.Item(1)
If Right(strPath, 1) <> "\" Then strPath = strPath + "\"
End With

If Documents.Count > 0 Then
Documents.Close SaveChanges:=wdPromptToSaveChanges
End If
strFile = Dir$(strPath & "*.do?")

While strFile <> ""
Set oDoc = Documents.Open(strPath & strFile)
ActiveWindow.View.ShowFieldCodes = True
For iFld = ActiveDocument.Fields.Count To 1 Step -1
With ActiveDocument.Fields(iFld)
If .Type = wdFieldDate Then
.Code.Text = Replace(UCase(.Code.Text), "DATE", "CREATEDATE")
.Update
End If
If .Type = wdFieldTime Then
.Code.Text = Replace(UCase(.Code.Text), "TIME", "CREATEDATE")
.Update
End If
End With
Next iFld
ActiveWindow.View.ShowFieldCodes = False
oDoc.Close SaveChanges:=wdSaveChanges
strFile = Dir$()
Wend
End Sub


http://www.gmayor.com/installing_macro.htm


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top