Date fields

W

Walt G

Is there any way I can arrange it so that when I insert a date into a
document via the Insert menu it uses CREATEDATE rather than DATE? As it is,
even though I have left the 'update automatically' box unchecked, when I for
example change the view from normal to print view, I find all the various
dates in my document relating to the times different parts of it were
created update to the current date. Also, is there any way I can change
dates already inserted into my document via the insert menu to use
CREATEDATE at one time rather than changing each one manually using toggle
field codes?
 
G

Greg

Walt,

I don't follow the first part of your question. CreateDate sets the
date the document was created and not the date the field was inserted.
If you have a journal or log and need to insert dates as you keep the
log then you need to insert date stamps (text that then never changes).
Here is an example of a macor to insert today's date (whatever day it
is) and format it as text. It will always stay the same.

Sub DateStamp()
' Inserts current date
Selection.InsertDateTime DateTimeFormat:="MMMM dd, yyyy", _
InsertAsField:=False
End Sub


If you want to convert all Date field to CreateDate field, you can use
this macro:

Sub ConvertDateFieldsToCreateDate()
Dim oFld As Field
Dim rngStory As Word.Range
For Each rngStory In ActiveDocument.StoryRanges
Do
For Each oFld In rngStory.Fields
If oFld.Type = wdFieldDate Then
oFld.Code.Text = "CreateDate"
End If
Next
Set rngStory = rngStory.NextStoryRange
Loop Until rngStory Is Nothing
Next
End Sub
 

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