Word Dates

D

dbunhook

I am creating a document that contains and itinerary. Each day of the
itinerary has a schedule of things to do on that day. I want to include the
date on each page. I set up a custom date in document properties as the start
date for the itinerary. I used information contained in this forum to create
a field code that displays the date for the appropriate day of the itinerary.
I can update the whole document by pressing Ctrl-A, and then F9. All the
dates show perfectly.

My problems is that when I print the document, the dates all change to
Sunday, July 6, 2006 in the document and on the printout.

I can't figure out how to copy/paste the field code into this questions, so
if you need it I will need some advice on that as well.

Help.......How can I get Word to show the date that is calculated when I
print?
 
M

macropod

Hi dbunhook,

If you're using the field coding from my Date Calc 'tutorial', at:
http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=249902
the simplest way to get the date to update on each page in the header would
be to put a field like the one under the heading 'Calculate a day, date,
month and year, using n (301) days delay' into your document's header and
change the line {SET Delay 310} to {SET Delay {={PAGE}-1}}.

To post your field coding as plain text, you can convert it with the
following macro:

Sub FieldCodeToString()
' Note: Needs MS Forms Object Library Reference to Work. See vba
Tools|References.
Dim Fieldstring As String, NewString As String, CurrChar As String
Dim CurrSetting As Boolean, fcDisplay As Object
Dim MyData As DataObject, X As Integer
NewString = ""
Set fcDisplay = ActiveWindow.View
Application.ScreenUpdating = False
CurrSetting = fcDisplay.ShowFieldCodes
If CurrSetting <> True Then fcDisplay.ShowFieldCodes = True
Fieldstring = Selection.Text
For X = 1 To Len(Fieldstring)
CurrChar = Mid(Fieldstring, X, 1)
Select Case CurrChar
Case Chr(19)
CurrChar = "{"
Case Chr(21)
CurrChar = "}"
Case Else
End Select
NewString = NewString + CurrChar
Next X
Set MyData = New DataObject
MyData.SetText NewString
MyData.PutInClipboard
fcDisplay.ShowFieldCodes = CurrSetting
End Sub

Cheers
 

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