automate loading 100 jpg files into wordpad
Posted on 2001-09-13
This is the first question I have ever posted, so please bear with me.
I want to use Visual Basic to create a program to automate the process of loading 100 jpg files into Wordpad. I have been to ms site and found info on automating the creation of word documents, but nothing for Wordpad (using Word is not an option). Using example Word commands for wordpad did not work.
I created an Access db in VB which is used to categorize a few thousand jpg picture files. The jpg files are not stored in the db itself, just their file names are stored. The db is used to print out a catalog of jewelry. User selects what to print, eg earrings, then all those jpg files categorized as earrings are filtered out of the db and automatically loaded into Wordpad to be viewed and printed. All VB forms and code for the db stuff is completed, eg add picture, edit db, select what to print, etc. I just need to add the code to automate the loading of the jpg files.
Thank you for any help you can provide.
I originally envisioned adding a Wordpadctl control to a form and creating the catalog on the fly by adding the jpg files to it. Using a richtextbox in some way is also an option if it isn't too kludgy. What I really want is, after user selects what to print, the next thing they see is a Wordpad doc where they can print preview, edit, print, etc. the resulting document.
I have tried using richtext box with below code
RichTextBox1.TextRTF = "ABC Jewelry Catalog"
RichTextBox1.OLEObjects.Add , , _
But the jpg always gets inserted at the beginning of the file (I don't know much about richtextbox and how to create a file with text and graphics). I also have a picture box on the same form as above code. This picture box has lrg1.jpg in it. When I drag and drop lrg1.jpg to the richtextbox1 it is NOT inserted as an ole object (double clicking on it does not invoke ms photo editor). I actually prefer it this way, eg not to be editable.
Sorry for the long winded response. Bottom line: after user selects what to print, the next thing they see is a Wordpad doc where they can print preview, edit, print, etc. the resulting document. Thanks.