cancel page save RRS feed

  • Question

  • Not sure if this is the right forum, but I am trying to build an Addin for Expression Web 2 using VS 2008. 
    When handling the OnBeforePageSave I want to cancel the save if I detect something is wrong on the page.
    To test if that works I just assing Cancel to true, but to my surprise it still saves the page.
    This is the code:
    void ewApp_OnBeforePageSave(PageWindow pPage, ref bool SaveAsUI, ref bool Cancel)  
      Cancel = true;  
      SaveAsUI = false;  
    The code gets called as I hit breakpoints, but I played around with setting Cancel and/or SaveAsUI to true/false and it always saves the page.
    Am I doing something wrong or is this not the way to cancel a save?


    • Moved by Cindy Meister MVP Thursday, October 23, 2008 1:48 PM Off-topic in the VSTO forum. (Moved from Visual Studio Tools for Office to Off-Topic Posts (Do Not Post Here))
    Thursday, October 23, 2008 1:39 PM

All replies