473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How do I refer to the OLE Class name for an MSPaint image file in A97?

MLH
Here's some example code taken from A97 HELP...

Sub Command1_Click
OLE1.Class = "Excel.Sheet" ' Set class name.
OLE1.OLETypeAllowed = acOLELinked ' Specify type of
object.
OLE1.SourceDoc = "C:\Excel\Oletext.xls" ' Specify source file.
OLE1.SourceItem = "R1C1:R5C5" ' Specify data to create link
to.
OLE1.Action = acOLECreateLink ' Create linked object.
OLE1.SizeMode = acOLESizeZoom ' Adjust control size.
End Sub

I'd like to view images created in MS Paint. Some are JPEG's and
others are BMP's. I have a table furnishing data to a form. As I flip
through the records on the form, I'd like to see the JPG and BMP
images referenced in my table field named [ChkImageFile]. The string
there is a full pathspec to the image. IE, "c:\MyDir\MyImage.jpg"

(1) What Class name should I use? MS Paint HELP doesn't specify.
(2) Will Class name change based on image type (jpg / bmp)?
(3) Can I leave SourceItem alone? Or must I specify?

Sep 18 '07 #1
4 7588
If you place an image control on your form you can reference image files
like this:

Image1.Picture = "C:\someDir\testPic.jpg"

Or in the current event of the form you can cycle through image files as
you move from one record to the next if your records contain a field
that references the locations of images.

Note: always better to reference the location of images on the
harddrive than to store images in the database as ole objects. Ole
objects will bloat your db very quickly.

Image1.Picture = "C:\someDir\testPic.jpg"

Private Sub Form_Current()
Image1.Picture = rsClone!ImageLocation
rsClone.MoveNext
End Sub

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Sep 18 '07 #2
MLH
Thx for the suggestion. But OLEUnbound119.Picture = Me!ChkImageFile
did not work for me. I got runtime error 438 "Object doesn't support
this property or method". I'm not aware of any picture property for
inserted OLE object in Access 97.

Am I doing something wrong?
Sep 18 '07 #3
Sorry. I am using Acc2003 which has an Image control. I am pretty sure
Acc97 also has an image control. Check to make sure you are using an
Image control. Then the picture method should work. there are 3
controls that look like image controls in the Design toolbox. One is an
unbound Ole control, one is a bound Ole control, and the first one is an
image control. make sure you selected an image control.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Sep 18 '07 #4
MLH
Yes, you are exactly right. I was equating an image control
an OLE control. Not the same. Not even close. Now that I
followed your recommendation, using the IMAGE control, things
are working as you stated. Thank-you for having the patience
to reply.

Mike H
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Sep 19 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Tam | last post by:
Having problems with this code. ProcessStartInfo info = new ProcessStartInfo(); info.FileName = ("mspaint.exe"); info.Arguments = image.getFileName; // returns full path and name...
1
by: André Nogueira | last post by:
Hi there. I'd like to allow the user to create some free-form drawing in my application, in the style of Microsoft Paint (the Brush tool) or Paint.Net. I've looked through Paint.Net's source code,...
0
by: Deepak C.G via .NET 247 | last post by:
I want to dispose the image object in my child form, unless I won't dispose this object i can't delete the image file in my folder. I get this error in MDIparent form "An unhandled exception...
2
by: somaskarthic | last post by:
Hi In my php page my i'm displaying a image. The image resides in the same location where the php page resides. when i refer other image src other than in the document root , it is not working....
0
by: Matt | last post by:
Good afternoon all, I have a VB.NET 2005 application that I'm looking to add some functionality to. The basic idea is to have a place where the user can create a little sketch and save it. ...
19
by: active | last post by:
The ColorPalette class has no constructor so how does one use it? I define a variable by: Dim cp as ColorPalette but don't know how assign an object to the variable. Thanks in advance
2
by: Amzul | last post by:
hello all i search the net for upload picture secure code i fuond this code, and affter i changed it abit it looks like that : <?php class image_upload { var $tmp_image; var...
3
by: MLH | last post by:
What's the best way to launch MSPAINT c:\image.bmp from a VBA procedure. Seeking the route with the least number of complications. Hopefully there will be no more complications than if I clicked...
8
by: cobolguy | last post by:
I can execute mspaint using VBA but I have not been successful trying to open a .jpg image file. This command works to execute mspaint but I do not know how to excute and bring up a file at the same...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.