T
Ted Hansen
Good evening hope this is the right forum for this type of quesiton...
I have a letterhead template with a different first page than the subsequent pages. I have attempted to automate my letterhead, so I can add it after I have completed the verbiage from a blank document via a macro.
When I use the macro, it only reapeats the first page letterhead over and over instead of switching over to the subsequent pages that are already in the template I built.
When I use a macro I built to remove the letterhead from a document I created from within the original "letterhead" template only the first page deletes and all subsequent pages keep the second page formatting (trying to make it blank).
I followed everything as laid out in the site below, but feel that I am missing something.
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=528a
--- CODE For MACRO I have recorded is below ---
******INSERT LOGO******
Sub InsertLogo()
'
' InsertLogo Macro
' Macro recorded 10/17/2007 by angeli
'
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
Application.DisplayAutoCompleteTips = True
With AutoCorrect
.CorrectInitialCaps = True
.CorrectSentenceCaps = True
.CorrectDays = True
.CorrectCapsLock = True
.ReplaceText = True
.ReplaceTextFromSpellingChecker = True
.CorrectKeyboardSetting = False
.DisplayAutoCorrectOptions = True
.CorrectTableCells = True
End With
ActiveDocument.AttachedTemplate.AutoTextEntries("Logo").Insert Where:= _
Selection.Range, RichText:=True
Application.DisplayAutoCompleteTips = True
With AutoCorrect
.CorrectInitialCaps = True
.CorrectSentenceCaps = True
.CorrectDays = True
.CorrectCapsLock = True
.ReplaceText = True
.ReplaceTextFromSpellingChecker = True
.CorrectKeyboardSetting = False
.DisplayAutoCorrectOptions = True
.CorrectTableCells = True
End With
ActiveDocument.AttachedTemplate.AutoTextEntries("LogoBar").Insert Where:= _
Selection.Range, RichText:=True
If Selection.HeaderFooter.IsHeader = True Then
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
Else
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
End If
Application.DisplayAutoCompleteTips = True
With AutoCorrect
.CorrectInitialCaps = True
.CorrectSentenceCaps = True
.CorrectDays = True
.CorrectCapsLock = True
.ReplaceText = True
.ReplaceTextFromSpellingChecker = True
.CorrectKeyboardSetting = False
.DisplayAutoCorrectOptions = True
.CorrectTableCells = True
End With
ActiveDocument.AttachedTemplate.AutoTextEntries("LogoFooter").Insert Where _
:=Selection.Range, RichText:=True
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
End Sub
******REMOVAL OF LOGO******
Sub RemoveLogo()
'
' RemoveLogo Macro
' Macro recorded 10/17/2007 by angeli
'
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
Selection.WholeStory
Selection.Delete Unit:=wdCharacter, Count:=1
If Selection.HeaderFooter.IsHeader = True Then
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
Else
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
End If
Selection.WholeStory
Selection.Delete Unit:=wdCharacter, Count:=1
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
End Sub
I have a letterhead template with a different first page than the subsequent pages. I have attempted to automate my letterhead, so I can add it after I have completed the verbiage from a blank document via a macro.
When I use the macro, it only reapeats the first page letterhead over and over instead of switching over to the subsequent pages that are already in the template I built.
When I use a macro I built to remove the letterhead from a document I created from within the original "letterhead" template only the first page deletes and all subsequent pages keep the second page formatting (trying to make it blank).
I followed everything as laid out in the site below, but feel that I am missing something.
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=528a
--- CODE For MACRO I have recorded is below ---
******INSERT LOGO******
Sub InsertLogo()
'
' InsertLogo Macro
' Macro recorded 10/17/2007 by angeli
'
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
Application.DisplayAutoCompleteTips = True
With AutoCorrect
.CorrectInitialCaps = True
.CorrectSentenceCaps = True
.CorrectDays = True
.CorrectCapsLock = True
.ReplaceText = True
.ReplaceTextFromSpellingChecker = True
.CorrectKeyboardSetting = False
.DisplayAutoCorrectOptions = True
.CorrectTableCells = True
End With
ActiveDocument.AttachedTemplate.AutoTextEntries("Logo").Insert Where:= _
Selection.Range, RichText:=True
Application.DisplayAutoCompleteTips = True
With AutoCorrect
.CorrectInitialCaps = True
.CorrectSentenceCaps = True
.CorrectDays = True
.CorrectCapsLock = True
.ReplaceText = True
.ReplaceTextFromSpellingChecker = True
.CorrectKeyboardSetting = False
.DisplayAutoCorrectOptions = True
.CorrectTableCells = True
End With
ActiveDocument.AttachedTemplate.AutoTextEntries("LogoBar").Insert Where:= _
Selection.Range, RichText:=True
If Selection.HeaderFooter.IsHeader = True Then
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
Else
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
End If
Application.DisplayAutoCompleteTips = True
With AutoCorrect
.CorrectInitialCaps = True
.CorrectSentenceCaps = True
.CorrectDays = True
.CorrectCapsLock = True
.ReplaceText = True
.ReplaceTextFromSpellingChecker = True
.CorrectKeyboardSetting = False
.DisplayAutoCorrectOptions = True
.CorrectTableCells = True
End With
ActiveDocument.AttachedTemplate.AutoTextEntries("LogoFooter").Insert Where _
:=Selection.Range, RichText:=True
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
End Sub
******REMOVAL OF LOGO******
Sub RemoveLogo()
'
' RemoveLogo Macro
' Macro recorded 10/17/2007 by angeli
'
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
Selection.WholeStory
Selection.Delete Unit:=wdCharacter, Count:=1
If Selection.HeaderFooter.IsHeader = True Then
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
Else
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
End If
Selection.WholeStory
Selection.Delete Unit:=wdCharacter, Count:=1
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
End Sub