none
How do I insert a image into a paragraph / table cell of a Docx file using Open xml SDK2. RRS feed

  • Question

  • Hi I am currently tring to link an image into a Paragraph / table cell. I have loaded the image as Part, but am unable to link the image into the word xml.
    All the code so far has been in C# or uses some one elses libraries.
    Has anyone got VB.net samples as this will at least give me a starting point. 
     
    Still learning
    • Moved by Reed KimbleMVP Tuesday, September 1, 2009 10:19 PM Open XML Question in VB Language (From:Visual Basic Language)
    Monday, August 31, 2009 1:22 PM

Answers

  • Sorry if my description wasn't correct, I have been able to add an image into the package but I have been unable to use the image in either a table cell or paragraph with in the Docx file I am creating. To you other question it would be nice that a DocumentReflector tool be able to generate VB as well. To the question about refactoring C# to VB, I am still getting my head around the higher levels of VB at the moment, I have looked at C# but i am not quite getting my head around it yet.
    Thanks for your help on this
    Paul

    Still learning
    • Marked as answer by PELF Sunday, March 13, 2011 4:15 PM
    Wednesday, September 2, 2009 6:48 AM

All replies

  • I know you are looking for VB samples, but I think you will have better luck with someone from the Open XML forum helping you in VB than you will with someone in the VB forums helping with Open XML, so I'm going to move this thread over there.
    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"
    Tuesday, September 1, 2009 10:19 PM
  • So what do you mean by linking? Did you mean just inserting? You could try to do the same thing from the Word App and see what content has been added in the MainDocumentPart (document.xml). Then you could use the VB code to reproduce that content.

    BTW, if we have the C# code that does this, would you be able to convert that code into VB code easily? I am asking this because we have a tool to produce C# code automatically for any xml fragment of document content. The produced C# code could then be run and reproduce the content programmatically. The tool is called DocumentReflector.

    Lanqing Brownell
    MS
    Wednesday, September 2, 2009 12:07 AM
  • Sorry if my description wasn't correct, I have been able to add an image into the package but I have been unable to use the image in either a table cell or paragraph with in the Docx file I am creating. To you other question it would be nice that a DocumentReflector tool be able to generate VB as well. To the question about refactoring C# to VB, I am still getting my head around the higher levels of VB at the moment, I have looked at C# but i am not quite getting my head around it yet.
    Thanks for your help on this
    Paul

    Still learning
    • Marked as answer by PELF Sunday, March 13, 2011 4:15 PM
    Wednesday, September 2, 2009 6:48 AM