954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Word Automation Image save in jpg format

In word automation, how ca i retrive and save images from a word file's header section. I can get the counting of header section's images but want to save them or extract them into jpg format onto my harddisk. I m using "Microsoft.Office.Interop.Word" dll.

Code is : ------

object oMissing = System.Reflection.Missing.Value;
        //OBJECT OF MISSING "NULL VALUE"
        //Object oMissing = System.Reflection.Missing.Value();
        //OBJECTS OF FALSE AND TRUE
        object oTrue = true;
        object oFalse = false;
        object oEndOfDoc = "\\endofdoc"; /* \endofdoc is a predefined bookmark */
        Word._Application oWord;
        Word._Document oDoc;
        oWord = new Word.Application();
        //oWord.Visible = true;
        oWord.Visible = false;

        Object oOpenFile = (Object)"C:\\CRM.doc";
        oDoc = oWord.Documents.Open(ref oOpenFile, ref oMissing, ref oMissing, ref oMissing,
            ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
            ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
            ref oMissing, ref oMissing);

        foreach (Word.Section section in oDoc.Application.ActiveDocument.Sections)
        {
            foreach (Word.HeaderFooter header in section.Headers)
            {
                foreach (Word.Shape shape in header.Shapes)
                {
                    //Response.Write(header.Shapes.Count.ToString());
                }
            }
        }
        //CLOSING THE FILE
        oDoc.Close(ref oFalse, ref oMissing, ref oMissing);
        //QUITTING THE APPLICATION
        oWord.Quit(ref oMissing, ref oMissing, ref oMissing);
Munendra Kumar
Newbie Poster
3 posts since Aug 2008
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You