I'm using the code below to display images in a image box but when an image
is not available I would like the text "no image available" to be displayed
where the image should be in the image box
can this be done and if so how do I alter the code to achieve this
thanks phil
If Len(Dir("c:\schedule\images\cladding\" & cbcla_external & ".bmp")) > 0
Then
ImageCladding.Picture = LoadPicture("c:\schedule\images\cladding\" &
cbcla_external & ".bmp")
Doug Robbins - Word MVP - 31 May 2004 07:07 GMT
Hi Phil,
Might be better to create an image that contains that information and load
it if no image is available.
You can create such an image by using Copy then Edit>Paste Special>Picture.
Alternatively, overlay the image control with a label containing that
information and have it's visible property changed from False to True when
you want it to be displayed.

Signature
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
> I'm using the code below to display images in a image box but when an image
> is not available I would like the text "no image available" to be displayed
[quoted text clipped - 6 lines]
> ImageCladding.Picture = LoadPicture("c:\schedule\images\cladding\" &
> cbcla_external & ".bmp")
Jonathan West - 31 May 2004 18:49 GMT
Hi Phil,
you could have a label of exactly the same shape & size as the image
control, positioned behind the image and with the appropriate text included.
Then, when no image is available, set the Visible property of the Image
control to False, and the label behind will be revealed!

Signature
Regards
Jonathan West - Word MVP
http://www.multilinker.com
Please reply to the newsgroup
> I'm using the code below to display images in a image box but when an image
> is not available I would like the text "no image available" to be displayed
[quoted text clipped - 6 lines]
> ImageCladding.Picture = LoadPicture("c:\schedule\images\cladding\" &
> cbcla_external & ".bmp")