Quote:
Originally Posted by gmayor
It sounds like you are selecting something in the header/footer ranges rather than using the ranges to make changes. If you use the code I posted there is no selection involved and the screen display should not change . The update merely shows the field result.
|
I inserted the following lines, at the beginning and end of the procedure, solves the problem for 98% ;-)
Application.ScreenUpdating = False
ActiveDocument.ActiveWindow.View.SeekView = wdSeekCurrentPageFooter
...
ActiveWindow.View.Type = wdNormalView
ActiveWindow.View.Type = wdPrintView
It works, but from time to time I have a small right and left of the document (not of the window nor of the tab) at the insertion of the footers. I insert or delete the footers through a checkbox.
In the procedure AutoNew() and OnLoad(ribbon As IRibbonUI), I don't have any Selection, I only have Ranges. I don't seem to have any other procedure or function called when creating or opening the document.
Sincerely,
David