Solved

Diplaying the images from database on ms-word document

Posted on 2004-08-26
5
160 Views
Last Modified: 2010-05-02
Dear All,

I am creating a Visual Basic application in which i am storing the images (binary format) in ms-access database. Along with the images i am also storing some text and information.

Now i want to retrieve them from the Database and need to display the information and image in ms-word document. Is it possible to do?

I am very thankful if anyone can give me the idea to do this.

Thanks and Regards

Sridhar

0
Comment
Question by:Cherukuri30
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 250 total points
ID: 11910497
Hi again, take a look to this previous question about inserting a picture in a Word document:
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_10354042.html

Then, what you have to do is to retrieve picture from the Access database, save it in a temp file, and insert it into the document as described in the question.
0
 
LVL 7

Author Comment

by:Cherukuri30
ID: 11910582
i tried according to the above code i did not get any error message but image is not getting displayed in ms-word document.


Private Sub PictureToWord(DocName As String, PicturePath As String, Left As Integer, Top As Integer)
   Dim oWord As New Word.Application
    '/Then you want to open a new word document for which you will insert the image file
   Dim oDoc As Word.Document
    Set oDoc = oWord.Documents.Open(DocName)
    '/Now you insert the image in specific position
    Call oDoc.Shapes.AddPicture(PicturePath, False, True, Left, Top)
    '/To save the document with the image
    Call oDoc.SaveAs(DocName)
   oWord.Visible = True
End Sub

Private Sub Command1_Click()
Call PictureToWord("c:\images.doc", "c:\image.jpg", 100, 100)
End Sub


what could be possible mistake in the above
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 11910607
Have you tried the first code?
0
 
LVL 7

Author Comment

by:Cherukuri30
ID: 11910631
Thanks Jaime

I got it now, Thanks for your help and now i am gaining confidence. Hope i can seek your help in future too..

Regards

Sridhar
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 11910675
Thanks too, see you in next question.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question