none
Event when closing Reading view Word 07/10 RRS feed

  • Question

  • hi

    I can repurpose the Reading view button call, but I can't find out when the reading view is closed. Any suggestions? 

    Thanks:)

    Wednesday, March 21, 2012 3:38 PM

Answers

  • Hello,

    Try using the CommandBars.OnUpdate event to determine when the view changes. This event occurs really often so you need to reduce your code as much as possible.


    Regards from Belarus (GMT + 3),

    Andrei Smolin
    Add-in Express Team Leader

    Please mark answers and useful posts to help other developers use the forums efficiently.

    • Marked as answer by Bruce Song Monday, April 2, 2012 3:45 AM
    Thursday, March 22, 2012 11:54 AM

All replies

  • You could test what the current view is:

    If Application.ActiveWindow.View <> 7 then 'do something


    Kind Regards, Rich ... http://greatcirclelearning.com

    Wednesday, March 21, 2012 5:25 PM
  • The question is where to put that test. The only callback I could see was triggered when exiting the Reading view both in 07 and 10 is the CustomTaskPane.VisibleChanged. Bad place to add code to check for this!

    In 2007 I get three callbacks to the repurposed ReadingView callback method when clicking the Reading View ribbon button (bad). When exiting the reading view I get one callback to this same function (good)

    In 2010 I get one callback to my repurposed ReadingView callback method when clicking the Reading View ribbon button (good). When exiting the reading view I don't get a callback (bad)

    Thursday, March 22, 2012 9:20 AM
  • In you ReadingView callback set a boolean variable value to true.  Then code intercepting callbacks for the "ViewPrintLayoutView", "ViewWebLayoutView", "ViewOutlineView" and "ViewDraftView" toggles. In those callbacks if your boolean variable is True then take the appropriate action.

    Hope that helps


    Kind Regards, Rich ... http://greatcirclelearning.com


    Thursday, March 22, 2012 10:51 AM
  • No, that doesn't help. The callback for print layout is called when exiting reading view in 2007, but not in 2010. Meaning I can't do it that way
    Thursday, March 22, 2012 11:35 AM
  • Hello,

    Try using the CommandBars.OnUpdate event to determine when the view changes. This event occurs really often so you need to reduce your code as much as possible.


    Regards from Belarus (GMT + 3),

    Andrei Smolin
    Add-in Express Team Leader

    Please mark answers and useful posts to help other developers use the forums efficiently.

    • Marked as answer by Bruce Song Monday, April 2, 2012 3:45 AM
    Thursday, March 22, 2012 11:54 AM