hello greg
i have modified the code as follows
Sub ScratchMacro()
Dim lngWords As Long
Dim pMinutes As Long
Dim oDoc As Document
Dim oSec As Section
Dim oRng As Range
Set oDoc = ActiveDocument
For Each oSec In oDoc.Sections
With oSec.Headers(wdHeaderFooterPrimary)
.LinkToPrevious = False
Set oRng = .Range
With oRng
.Text = "Page: "
.Collapse wdCollapseEnd
.Fields.Add oRng, wdFieldPage
.Collapse wdCollapseEnd
.Move wdCharacter, 1
lngWords = oSec.Range.ComputeStatistics(wdStatisticWords)
pMinutes = (lngWords / 3)
.Text = " Length: " & Format$(pMinutes / 86400, "hh:mm:ss")
.Collapse wdCollapseEnd
.Fields.Add oRng, wdFieldDate, "\@ ddd-d-MMM-yyyy"
.Text = " Date: "
End With
End With
Any idea why the length and date wouldnt show up after page 9 of any
document. However the page number is shown until the end of the documnt.
every new page is a new section.
Any help would be appreciated
thanx
ahmed
> Hey Greg
>
[quoted text clipped - 132 lines]
> > > >>>>>> thanx
> > > >>>>>> ahmed
Greg Maxey - 06 Aug 2006 17:06 GMT
This was a puzzle ;-). It has to do with the move character statement.
When the number of pages exceeded one digit then it messed up.
Change:
.Move wdCharacter, 1
To:
.Move wdCharacter, 2 'or 3 if you have more than 99 pages.

Signature
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.
> hello greg
>
[quoted text clipped - 180 lines]
>>>>>>>>>> thanx
>>>>>>>>>> ahmed
FotoArt - 06 Aug 2006 18:33 GMT
Hello Greg
thanx for the help
Its working fine
Ahmed
> This was a puzzle ;-). It has to do with the move character statement.
> When the number of pages exceeded one digit then it messed up.
[quoted text clipped - 189 lines]
> >>>>>>>>>> thanx
> >>>>>>>>>> ahmed