Solved

automate loading 100 jpg files into wordpad

Posted on 2001-09-13
4
325 Views
Last Modified: 2006-11-17
Hi,
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.
Scott

Additional info:
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 , ,  _
    "C:\MyDocuments\catalogmaker\images\lrg1.jpg"
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.
Scott
0
Comment
Question by:whetzels
4 Comments
 
LVL 28

Accepted Solution

by:
AzraSound earned 100 total points
Comment Utility
Have you considered using the RichTextBox control?  You can then easily embed your images, and save it as an *.rtf file, thus, viewable by anyone who has WordPad.  (shelling the file would just launch the user's default application for handling *.rtf files)
0
 
LVL 22

Expert Comment

by:rspahitz
Comment Utility
Alternately, this could be a relatively easy VB program to write and turn into an executable.
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
Hi whetzels,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept AzraSound's comment(s) as an answer.

whetzels, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 5

Expert Comment

by:Netminder
Comment Utility
Per recommendation, force-accepted.

Netminder
CS Moderator
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…

762 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

11 Experts available now in Live!

Get 1:1 Help Now