#16
|
|||
|
|||
Quote:
The problem I have now is that when updating the fields, for each footer, the screen display changes, it goes from normal mode to draft mode or something like that, and it's not great for the user. I partly solve this problem with : Application.Visible = False ... Application.Visible = True ActiveWindow.View.Type = wdNormalView ActiveWindow.View.Type = wdPrintView Well, it's not great, since the application disappears and comes back once the job is done. Is there any solution to keep the screen from moving or changing, like "oFooter.Range.Delete" does so nicely? Best regards, David |
#17
|
||||
|
||||
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.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#18
|
|||
|
|||
Quote:
I'll check if it could be from another procedure or function done before. In this one, I only use Range and not Seclection. See you later |
#19
|
|||
|
|||
Quote:
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 |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Distribute text in one cell across a range of cells (overcoming selection.range.cells.count bug) | slaycock | Word VBA | 0 | 02-18-2017 07:00 AM |
Working with Selection.range. | PRA007 | Word VBA | 2 | 02-19-2016 12:52 AM |
Search and reduce the range of a text selection | paik1002 | Word VBA | 1 | 12-17-2015 04:51 AM |
Selection or Range | Tommes93 | Word VBA | 1 | 04-10-2014 02:50 AM |