Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2006

Tip: Looking for answers? Try searching our database.

Word Dates

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dbunhook - 05 Nov 2006 20:40 GMT
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?
macropod - 05 Nov 2006 21:33 GMT
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

Signature

macropod
[MVP - Microsoft Word]

> 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
[quoted text clipped - 12 lines]
> Help.......How can I get Word to show the date that is calculated when I
> print?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.