J
Jeremiah
I have created a macro in word that
inserts a new section break on a new page, opens the header on the new page, unlinks the new page header from the previous, selects and deletes the image in the header, and then replaces it with one specific to the macro.
The macro works except for one problem.
Instead of correcting the header on the new page.
the macro changes the page before it (The page where the macro was started).
Here is the cod
Sub Header_EconomicDevelopment(
' Header_EconomicDevelopment Macr
' Inserts a new section with Economic Development Heade
Selection.InsertBreak Type:=wdSectionBreakNextPag
If ActiveWindow.View.SplitSpecial <> wdPaneNone The
ActiveWindow.Panes(2).Clos
End I
If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow.
ActivePane.View.Type = wdOutlineView The
ActiveWindow.ActivePane.View.Type = wdPrintVie
End I
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeade
Selection.HeaderFooter.LinkToPrevious = Not Selection.HeaderFooter.
LinkToPreviou
Selection.Delete Unit:=wdCharacter, Count:=
Selection.InlineShapes.AddPicture FileName:=
"I:\Report_Headers\Header_EconomicDevelopment.jpg", LinkToFile:=False,
SaveWithDocument:=Tru
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocumen
End Su
I have looked through the code and I cannot seem to find what is causing the macro to shift back to the previous page.
No stepes seem to be out of place.
Any feedback would be extremely wonderful
thanks
-Jeremiah
inserts a new section break on a new page, opens the header on the new page, unlinks the new page header from the previous, selects and deletes the image in the header, and then replaces it with one specific to the macro.
The macro works except for one problem.
Instead of correcting the header on the new page.
the macro changes the page before it (The page where the macro was started).
Here is the cod
Sub Header_EconomicDevelopment(
' Header_EconomicDevelopment Macr
' Inserts a new section with Economic Development Heade
Selection.InsertBreak Type:=wdSectionBreakNextPag
If ActiveWindow.View.SplitSpecial <> wdPaneNone The
ActiveWindow.Panes(2).Clos
End I
If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow.
ActivePane.View.Type = wdOutlineView The
ActiveWindow.ActivePane.View.Type = wdPrintVie
End I
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeade
Selection.HeaderFooter.LinkToPrevious = Not Selection.HeaderFooter.
LinkToPreviou
Selection.Delete Unit:=wdCharacter, Count:=
Selection.InlineShapes.AddPicture FileName:=
"I:\Report_Headers\Header_EconomicDevelopment.jpg", LinkToFile:=False,
SaveWithDocument:=Tru
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocumen
End Su
I have looked through the code and I cannot seem to find what is causing the macro to shift back to the previous page.
No stepes seem to be out of place.
Any feedback would be extremely wonderful
thanks
-Jeremiah