How to Preview Open XML before Insert RRS feed

  • Question

  • Hi,

    I'm developing a Word Application add-in - one of the features enables the user to insert content from a data source into the word active documenet. For the data source we are using another word document which is basically just many content controls with formatted text in them. In a custom dialog/task pane I want to be able to...

    1. Open the data source (transparently to the user)

    2. Browse a list of the content controls contained in the data source

    3. Click on a list item and see a preview of the formatted text in the content control

    It all look straight forward except I'm not sure how I can show a preview (step 3).

    Can anyone help out with this please?


    Thursday, September 15, 2011 2:13 AM


  • Hi Martin

    There isn't going to be any simple, straightforward way to do this, as neither VBA UserForms not Windows Forms support displaying formatted text coming from Office Open XML. You'd have to "transform" this into RTF acceptable to a Windows Forms RichText control. And even then, there are things in Word that can't be displayed by any type of forms control.

    The Word application is (consciously) not designed to be embedded in a form.

    So if you don't want to go the transformation route, about the best you could do would be to display the content in a Word document window beside the form.

    Cindy Meister, VSTO/Word MVP
    Thursday, September 15, 2011 6:15 AM