Getting Pictures from Word Documents

ClaudioPereiraClaudioPereira Member Posts: 38
Hi All,

I am currently working on a Document Management Add-on for my company, and am facing a challenge:

One of the functionality requires me to "read' a Word document, placing the texts into NAV tables, and import any embedded pictures as attachments.

I can read the text perfectly, but have found no means of getting access to the pictures by code. Has anyone here ever been successful at something similar? And if so how do I do it?

I'm sure there should be a way, as I am able to do the reverse acction (putting pictures in a word document), using this code:
Attach.ExportAttachment(TempPic);
wrdSel.InlineShapes.AddPicture(TempPic);

Thanks in advance

Comments

  • SavatageSavatage Member Posts: 7,142
    do you want to inport into a blob field or save it to a location and save the path & filename? attachment to what an item card?
  • garakgarak Member Posts: 3,263
    mhm, i know no standard MS solution to export a embedded picture from MS Word.

    In this case i do following: Save the document as WebSite. In this case the puctires stored as ThumbNail and in Original format. After saving as WebSite you can import the Picture(s) from the folder.

    Regards
    Do you make it right, it works too!
  • ClaudioPereiraClaudioPereira Member Posts: 38
    Savatage wrote:
    do you want to inport into a blob field or save it to a location and save the path & filename? attachment to what an item card?
    Anything is fine, it's going to be imported into NAV as a blog (using the standard functionality of the Attachments table, but my issue is that I can't even access the picture to save it in any way. Is there a method or property of the Word Automation that i'm just not seeing?

    Regards
  • FramusFramus Member Posts: 13
    see this, maybe there is some idea (or maybe not :( )
    http://forums.microsoft.com/MSDN/ShowPo ... 3&SiteID=1
  • maheshmahesh Member Posts: 115
    Hello Claudio Pereira\NAV Experts,

    would you\anybody please share code about reading text from word document & storing in NAV tables (where field size is 80 Char)?
    I searched forums but didn't get exactly what i'm expecting.
    It would be gr8 help.

    Thanks,
    Mahesh Jain
    Best Regards,
    Mahesh Jain
    mahesh@reliconservices.com
  • kinekine Member Posts: 12,562
    Why you want to do that? Word is for writing long texts, NAV is for structured info. Use correct tools for correct purposes...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • maheshmahesh Member Posts: 115
    Hello Kine,

    Thanks for your reply.
    I want to upload word document in NAV.
    i.e. my client gets details in word document from its customers.

    Instead of importing document in NAV as attachment, they would like to upload text of word document in Sales Comment line table.
    They want it to be automized.
    i.e. Function->Upload Document.
    It will ask me Path of file and All Text of word document would be copied into Sales Comment line table.
    Please let me know, if you are still not clear.

    Thanks again
    Best Regards,
    Mahesh Jain
    mahesh@reliconservices.com
  • kinekine Member Posts: 12,562
    You can use the Microsoft Word automations to open the file, take the content, look at it as on text, and do whatever you want with it. Of course, you need to take into account limited text length in NAV.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • maheshmahesh Member Posts: 115
    Thanks Kine,

    That's what i'm looking for.
    Actually, i want to have the code (exact programming syntax).. please share if you know.

    I have used WaldoNotepad also which is best fit to my requirement. Waldo has also taken care that if Text field size is 80 Char, 75 chars are already used & Next Word is of 6 char then it would go in next line. :)
    But I'll have to ask client to copy word document text into WaldoNotepad which he will never. :whistle:

    Thanks,
    Best Regards,
    Mahesh Jain
    mahesh@reliconservices.com
  • kinekine Member Posts: 12,562
    Sorry, if you are developer, it is on you to create the code. Normally, I am paid for such a work. You have what you need to know, try to do it yourself. If you have some problems, you can ask, but the forum is not here to do work for you (or instead you) for free.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • maheshmahesh Member Posts: 115
    My problem is the syntax of automation control which i'm novice with and Objective is not to get work done.
    Thanks for your response.
    Best Regards,
    Mahesh Jain
    mahesh@reliconservices.com
Sign In or Register to comment.