[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Diplaying the images from database on ms-word document

Posted on 2004-08-26
5
Medium Priority
?
163 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 1000 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

Industry Leaders: 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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

649 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