E
ESH
Hey
As a start I ran a macro with application visible.
From the macro recorder I learned to use the following statement
to unlink header/footer:
Selection.InsertBreak Type:=wdSectionBreakNextPage
' Cut link between herder/footer on page x and page x+1
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.HeaderFooter.LinkToPrevious = False
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
BUT it didn't work when I changed to run the application invisible :-(
In an earlier Q in this NG I was told that the ActiveWindow object only
worked correctly when application was visible.
I have tried to rewrite the script to the following:
Selection.InsertBreak Type:=wdSectionBreakNextPage
' Cut link between herder/footer on page x and page x+1
With ActiveDocument.Sections(ActiveDocument.Sections.Count)
.Headers(wdHeaderFooterPrimary).LinkToPrevious = False
.Footers(wdHeaderFooterPrimary).LinkToPrevious = False
End With
As far as I can see it does not work.
When I manually enters the header on the new page (doubleclicking on the
new header), it is STILL linked to previous page.
What am I doing wrong?
Ebbe
As a start I ran a macro with application visible.
From the macro recorder I learned to use the following statement
to unlink header/footer:
Selection.InsertBreak Type:=wdSectionBreakNextPage
' Cut link between herder/footer on page x and page x+1
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.HeaderFooter.LinkToPrevious = False
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
BUT it didn't work when I changed to run the application invisible :-(
In an earlier Q in this NG I was told that the ActiveWindow object only
worked correctly when application was visible.
I have tried to rewrite the script to the following:
Selection.InsertBreak Type:=wdSectionBreakNextPage
' Cut link between herder/footer on page x and page x+1
With ActiveDocument.Sections(ActiveDocument.Sections.Count)
.Headers(wdHeaderFooterPrimary).LinkToPrevious = False
.Footers(wdHeaderFooterPrimary).LinkToPrevious = False
End With
As far as I can see it does not work.
When I manually enters the header on the new page (doubleclicking on the
new header), it is STILL linked to previous page.
What am I doing wrong?
Ebbe