none
Repurposing FIleSave CancelDefault property not working RRS feed

  • Question

  • Hi,

    I have come across a bug, I believe when you re purpose the FileSave using the ribbon customui.

    The problem is in the code below, when you set your cancelDefault to true or false in your repurposed function, Word still saves the document and keeps a dirty document clean.

    The active document's saved property is false at the beginning and end of the routine but as soon as it comes out of it, it becomes True.

    • Open a a saved document
    • Edit the document and click on save.

    Am I correctly using this for what it was intended to be used for or is this another Microsoft bug

    Public Sub MyFileSave(control As IRibbonControl, ByRef CancelDefault)
        'Do Something or Nothing
        CancelDefault = True
    End Sub

    • Edited by Dosh49 Monday, November 12, 2012 4:23 PM
    • Moved by Cindy Meister MVPModerator Monday, November 12, 2012 5:24 PM Word-specific (From:General Office Development)
    Monday, November 12, 2012 4:13 PM

Answers

All replies

  • I'm not seeing a bug here.  I've uploaded a demo of repurposing the FileSave command: https://dl.dropbox.com/u/64545773/Demo%20Repurpose.docm

    Does it work for you and make sense?


    Greg Maxey Please visit my website at: http://gregmaxey.mvps.org/word_tips.htm

    • Marked as answer by Dosh49 Monday, November 12, 2012 10:05 PM
    Monday, November 12, 2012 7:15 PM
  • Hi Greg,

    Thank you for verifying this for me. You are right it works fine.  I tried your demo in my work environment and I had the same problem I reported until I tried it on a vanilla version of Word with no Template or COM Addins and it worked fine.

    By disabling each of the addins, I found out that a 3rd party COM addin called iManage was affecting the cancelDefault property. I now know who to blame.

    Thanks once again



    • Edited by Dosh49 Monday, November 12, 2012 10:04 PM
    Monday, November 12, 2012 10:03 PM