E
Ebbe
Hi
I have discovered that the behavior of macros is different when
Application.Visible = True and it is False.
I observed some problems when running the macro. I turned the
Application.Visible = True, debugged the code, corrected the errors, ran
some tests without debug, but still with Application.Visible = True.
As soon I changed Application.Visible = False, the resulting document, the
macro generated looked different.
How can I see follow thr progress in the document, as I step through
statements without having Application.Visible = True?
Are there some spicific behavior, that is different when Application.Visible
= True and Application.Visible = False (exept that the document is/is not
visible)?
In my examble I want the next page to have a new set of headers.
Standing at end of the document (end of page x) I use the following code:
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
' Delete all contense in herder of page x+1
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.WholeStory
Selection.Delete Unit:=wdCharacter, Count:=1
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
When Application.Visible = True, I have headers on page x and no headers on
page x+1.
When Application.Visible = False, I have No headers on page x and no headers
on page x+1.
It looks like there is a difference in what header/footer I am standing in
after inserting a SectionBreakNextPage and then doing a
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader.
Ebbe
I have discovered that the behavior of macros is different when
Application.Visible = True and it is False.
I observed some problems when running the macro. I turned the
Application.Visible = True, debugged the code, corrected the errors, ran
some tests without debug, but still with Application.Visible = True.
As soon I changed Application.Visible = False, the resulting document, the
macro generated looked different.
How can I see follow thr progress in the document, as I step through
statements without having Application.Visible = True?
Are there some spicific behavior, that is different when Application.Visible
= True and Application.Visible = False (exept that the document is/is not
visible)?
In my examble I want the next page to have a new set of headers.
Standing at end of the document (end of page x) I use the following code:
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
' Delete all contense in herder of page x+1
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.WholeStory
Selection.Delete Unit:=wdCharacter, Count:=1
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
When Application.Visible = True, I have headers on page x and no headers on
page x+1.
When Application.Visible = False, I have No headers on page x and no headers
on page x+1.
It looks like there is a difference in what header/footer I am standing in
after inserting a SectionBreakNextPage and then doing a
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader.
Ebbe