none
Creating ribbon dynamically RRS feed

  • Question

  • Hi All,

    I am creating my word ribbon by using CreateRibbonExtensibilityObject() function. Now the problem is, I want to initialise the ribbon depending upon some condition.

    1. If there is custom properties present in the document.

    Now this CreateRibbonExtensibilityObject() function is getting called even before the document is loaded. Is there any way to read the custom properties of the word document otherwise so that we can use the custom properties in CreateRibbonExtensibilityObject().

    Any response is appreciated.

    Thanks,

    Dipankar

    Wednesday, July 27, 2011 10:44 AM

All replies

  • I think you'd have to extract the information from the document before it's opened. Weather/how this is feasible depends on how the document is being opened?

    Could you please provide more information about your solution?


    Cindy Meister, VSTO/Word MVP
    Wednesday, July 27, 2011 10:54 AM
    Moderator
  •  

    Depending upon the no of custom properties of a document, we are going to load the ribbon. We are using the CreateRibbonExtensibilityObject() function for initialising the ribbon. In CreateRibbonExtensibilityObject function I need to have custom properties count of the document being opened. But I am not able to read those as CreateRibbonExtensibilityObject will be called even before document_open function.

    Is there anyway to achieve this ?

    Thanks,

    Dipankar

    Wednesday, July 27, 2011 11:31 AM
  • Repeating the original information will not help us get any further. You don't provide any additional information about HOW the document is being opened. Is the user clicking a button in Word? Some other interface? Something else?

    Is this a VSTO Add-in or a Document-level customization?


    Cindy Meister, VSTO/Word MVP
    Wednesday, July 27, 2011 1:14 PM
    Moderator
  • No it is normal opening of a word document by double clicking the document.Is there any way to fetch information about the document before it is being opened ?
    Thursday, July 28, 2011 8:43 AM
  • <<I am creating my word ribbon by using CreateRibbonExtensibilityObject() function>>

    But the Ribbon is defined in an Add-in? Or is this a VSTO document that's being opened?


    Cindy Meister, VSTO/Word MVP
    Thursday, July 28, 2011 9:06 AM
    Moderator
  • Hi

    Ribbon is defined in an Add-in

    Friday, July 29, 2011 10:35 AM