Word Automation, reading word document in XML format

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • R1gg4

    Word Automation, reading word document in XML format

    Hi all,

    I currently have a VB.NET application that interfaces with Word 2003 to
    produce documents from templates substituting the data in the template to
    form the document. This is all working including substituting images.

    However it is very slow as it uses the Word Object model to directly control
    the word.searchrepl ace function.

    I am now trying to change what we have so that it does the substitution in
    an XML formatted version of the word template document, which seems to be
    much easier.

    However, I now have a problem substituting images.

    The images in the word XML file are as below

    <w:binData
    w:name="wordml://02000001.jpg">/9j/4AAQSkZJRgABAQE ASABIAAD/2wBDAAEBAQEBAQE BAQEBAQEBAQEBAQ EBAQEBAQEBAQEBA QEB
    AQEBAQICAQECAQE BAgICAgICAgICAQ ICAgICAgICAgL/2wBDAQEBAQEBAQE BAQECAQEBAgICAg IC
    AgICAgICAgICAgI CAgICAgICAgICAg ICAgICAgICAgICA gICAgICAgICAgL/wAARCAgABgADASI A
    etc..

    My question is does anyone know what format the binary data is in? and how
    to convert it to an Image type in .NET?

    I have tried simple converting from a Base64 string then writing to a
    stream, then reading into an image but that does not work. Anyone any ideas?

    Any and all help much appreciated.
    R.


Working...