Macro question

A

Alex H

Hi

Can someone advise me why the following code when run produces the footer in
the order:
Date Page Number Created by

When the order of the code is Created By, Page Number and Date

Thanks

A

NormalTemplate.AutoTextEntries("Created by").Insert Where:=Selection.Range _
, RichText:=True
Selection.HeaderFooter.PageNumbers.Add PageNumberAlignment:= _
wdAlignPageNumberCenter, FirstPage:=True
Selection.InsertDateTime DateTimeFormat:="dd/MM/yyyy HH:mm",
InsertAsField _
:=True, DateLanguage:=wdEnglishUK, CalendarType:=wdCalendarWestern,
_
InsertAsFullWidth:=False
Selection.TypeText Text:=vbTab & vbTab
 
G

Graham Mayor

I suspect

ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
NormalTemplate.AutoTextEntries("Created by").Insert
Where:=Selection.Range
With Selection
.TypeText vbTab
.Fields.Add Range:=Selection.Range, Type:=wdFieldPage
.MoveRight Unit:=wdWord, Count:=1
.TypeText vbTab
.InsertDateTime DateTimeFormat:="dd/MM/yyyy HH:mm",
InsertAsField:=False
End With
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument

is closer to what you had in mind?


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


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

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