Cathy I am including the code:
The footer text is ALL deleted in preparation for new more appropritate text.
Putting the process in context, we have many documents (100's) that have been used by many people over an organisation and they have added their own footers. Now we are centralising and placing one copy of each document on an Intranet. So we are gathering these documents and giving them one consistant footer.
So, all existing footer text has to go, and new text used. This is what the macro is trying to do...and it works.
I am not happy because 300 characters seems kind of arbitary and not good coding form...
If possible I wish to select and delete ALL text in a footer before adding new text
CODE
If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
ActivePane.View.Type = wdOutlineView Then
ActiveWindow.ActivePane.View.Type = wdPrintView
End If
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
If Selection.HeaderFooter.IsHeader = True Then
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
Else
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
End If
[color="red"] Selection.MoveRight Unit:=wdCharacter, Count:=300, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.LanguageID = wdEnglishAUS [/color]
NormalTemplate.AutoTextEntries("Filename and path").Insert Where:= _
Selection.Range, RichText:=True
Selection.TypeParagraph
NormalTemplate.AutoTextEntries("Page X of Y").Insert Where:=Selection. _
Range, RichText:=True
Selection.TypeText Text:=vbTab & "Issue Date: "
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldDate
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument