View Single Post
 
Old 07-22-2022, 08:44 AM
VBAadvocate VBAadvocate is offline Windows 10 Office 2019
Novice
 
Join Date: Feb 2022
Posts: 12
VBAadvocate is on a distinguished road
Default Content Control Bug in Headers and Footers caused by Ribbon XML Callback

Hi, I found what I presume is a bug as follows:

' A bug that causes the Document_ContentControlOnExit to continuously trigger, which in my case,
' calls the RedoRib routine to refresh the ribbon which in turn causes the cursor to flicker,
' continuously. It occurs when entering a content control in the headers and footers only while the
' custom tab is active.

' It was tracked down and discovered that it occurs only when callbacks are included
' in the ribbon xml buttons for custom tabs.

' Effectively (strangely), the Document_ContentControlOnExit is repeatedly triggered.
' Further testing showed that getting the Range.Style property during the callback causes it.
' The fix was to change Range.Style to Range.Paragraphs(1).Style (strange!!).

' To repeat, only the controls in headers and footers caused the bug and only while the custom tab
' is active.

' Simply activating a different tab or clicking out of the control stops the bug.

See the attached file. It also has some more info on the first (only) page.
Attached Files
File Type: docm HeaderContentControlBug.docm (48.6 KB, 9 views)
Reply With Quote