Solved

Diplaying the images from database on ms-word document

Posted on 2004-08-26
5
155 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
Comment Utility
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
Comment Utility
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
Comment Utility
Have you tried the first code?
0
 
LVL 7

Author Comment

by:Cherukuri30
Comment Utility
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
Comment Utility
Thanks too, see you in next question.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now