none
Save/Modify office shared Ribbon textbox changes RRS feed

  • Question

  • Hi,

    I have shared ribbon with one textbox on it .textbox data saved when as a custom prop when save button clicked ,so when i open the doc same custom prop is showed in textbox.Now if i change the ribbon textbox data and click save ,save event is not triggered .it is trigered only when some changes made in word data,can any help me out with this.


    suresh

    Monday, January 7, 2013 5:18 AM

Answers

  • Hi suresh

    This is Word, I take it? This is the way Word has always behaved when the only change made is to a document property. I don't know why, but writing to a document property doesn't make the document "dirty".

    At the end of your code that writes a value to the document property, try setting:
      WordApp.ActiveDocument.Saved = False

    Where WordApp is the object you use in your add-in for the Word.Application. The Saved property tells Word whether there are any changes in the document to be saved (False = there are changes to be saved).


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by sureshcse29 Monday, January 7, 2013 9:05 AM
    Monday, January 7, 2013 7:11 AM
    Moderator

All replies

  • Hi suresh

    This is Word, I take it? This is the way Word has always behaved when the only change made is to a document property. I don't know why, but writing to a document property doesn't make the document "dirty".

    At the end of your code that writes a value to the document property, try setting:
      WordApp.ActiveDocument.Saved = False

    Where WordApp is the object you use in your add-in for the Word.Application. The Saved property tells Word whether there are any changes in the document to be saved (False = there are changes to be saved).


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by sureshcse29 Monday, January 7, 2013 9:05 AM
    Monday, January 7, 2013 7:11 AM
    Moderator
  • Thanks Cindy

    suresh

    Monday, January 7, 2013 9:05 AM