zonkd
05-11-2013, 08:54 AM
I'm hoping to use a header and footer on regular Word reports. This is what I have but there is at least one error here for above my message, I get - [Type text] Which I want to remove.
Very grateful for guidance, experts.
My macro is -
Sub AhHeadAnFeet()
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
MsgBox "We are running the new head and footers macro, gracias!"
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Application.Templates( _
"C:\Users\paul\AppData\Roaming\Microsoft\Document Building Blocks\1033\14\Built-In Building Blocks.dotx" _
).BuildingBlockEntries(" Blank").Insert Where:=Selection.Range, RichText _
:=False
Selection.TypeText Text:="weekly statistics | numbers for this week in May 2013 | "
Application.Templates( _
"C:\Users\paul\AppData\Roaming\Microsoft\Document Building Blocks\1033\14\Built-In Building Blocks.dotx" _
).BuildingBlockEntries("Plain Number").Insert Where:=Selection.Range, _
RichText:=True
Selection.TypeText Text:=" of "
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"NUMPAGES ", PreserveFormatting:=True
Selection.TypeText Text:=Chr(11) & _
"..........................................................."
Selection.TypeText Text:= _
"............................................................"
Selection.TypeText Text:="..................."
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Font.Name = "Bradley Hand ITC"
End Sub
Very grateful for guidance, experts.
My macro is -
Sub AhHeadAnFeet()
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
MsgBox "We are running the new head and footers macro, gracias!"
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Application.Templates( _
"C:\Users\paul\AppData\Roaming\Microsoft\Document Building Blocks\1033\14\Built-In Building Blocks.dotx" _
).BuildingBlockEntries(" Blank").Insert Where:=Selection.Range, RichText _
:=False
Selection.TypeText Text:="weekly statistics | numbers for this week in May 2013 | "
Application.Templates( _
"C:\Users\paul\AppData\Roaming\Microsoft\Document Building Blocks\1033\14\Built-In Building Blocks.dotx" _
).BuildingBlockEntries("Plain Number").Insert Where:=Selection.Range, _
RichText:=True
Selection.TypeText Text:=" of "
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"NUMPAGES ", PreserveFormatting:=True
Selection.TypeText Text:=Chr(11) & _
"..........................................................."
Selection.TypeText Text:= _
"............................................................"
Selection.TypeText Text:="..................."
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Font.Name = "Bradley Hand ITC"
End Sub