W
Walter Alexander
I have set up a macro to insert filename and path in the footer of a document
as follows. For some reason this code stops at the line of code midway down
where it is actually putting the info in the footer. All you see in the
document is "IF 1 = 1" on some workstation but not others. All workstations
are using the same image of Office installed some time ago. Does anyone have
any ideas what would cause this to happen??????
' RefTag Macro
' Macro recorded 10/7/2005 by
'
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
Selection.Font.Size = "10"
Selection.TypeText Text:="IF "
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldPage
Selection.TypeText Text:=" = "
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldNumPages
Selection.TypeText Text:=" "
ActiveDocument.AttachedTemplate.AutoTextEntries("Filename and path"). _
Insert Where:=Selection.Range, RichText:=True
Selection.HomeKey Unit:=wdLine, Extend:=wdExtend
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.EndKey Unit:=wdLine
Selection.Fields.Update
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.Fields.Update
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End Sub
as follows. For some reason this code stops at the line of code midway down
where it is actually putting the info in the footer. All you see in the
document is "IF 1 = 1" on some workstation but not others. All workstations
are using the same image of Office installed some time ago. Does anyone have
any ideas what would cause this to happen??????
' RefTag Macro
' Macro recorded 10/7/2005 by
'
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
Selection.Font.Size = "10"
Selection.TypeText Text:="IF "
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldPage
Selection.TypeText Text:=" = "
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldNumPages
Selection.TypeText Text:=" "
ActiveDocument.AttachedTemplate.AutoTextEntries("Filename and path"). _
Insert Where:=Selection.Range, RichText:=True
Selection.HomeKey Unit:=wdLine, Extend:=wdExtend
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.EndKey Unit:=wdLine
Selection.Fields.Update
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.Fields.Update
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End Sub