Hello all
I have a word document that has
- two column layout
- a table that has header repeating on all pages (and allow row breaking between pages turned OFF)
The document has about 40 pages.
I would like to loop through the document page by page, and add a section break at the end of each page (so that I can have a different header on every page)
I tried to do this:
But this results in 40 section breaks at the start of page 1.
I guess that
selects the entire document instead of the current page.
Any ideas on how to achieve what I want?
I have a word document that has
- two column layout
- a table that has header repeating on all pages (and allow row breaking between pages turned OFF)
The document has about 40 pages.
I would like to loop through the document page by page, and add a section break at the end of each page (so that I can have a different header on every page)
I tried to do this:
Code:
For i = 1 To Selection.Information(wdNumberOfPagesInDocument)
Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Name:=CStr(i)
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
ActiveDocument.Bookmarks("\page").Range.Select
Selection.InsertBreak Type:=wdSectionBreakContinuous
Next
But this results in 40 section breaks at the start of page 1.
I guess that
Code:
ActiveDocument.Bookmarks("\page").Range.Select
selects the entire document instead of the current page.
Any ideas on how to achieve what I want?