Solved

Diplaying the images from database on ms-word document

Posted on 2004-08-26
5
158 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
  • 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…

856 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