Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

clear picture from image box in word 1

Status
Not open for further replies.

sophic

IS-IT--Management
Mar 17, 2002
11
GB
I have placed an image control in a word document and added the option to load an image when doubleclicked and show the file and path in a label next to it. Using a command button control, how can I clear the image so that it reverts back to the grey square? I have tried every combination of things like 'Image1.Picture = Empty' and 'Image1.Picture.Delete' and 'Set Image1.Picture = Clear' and I'm now out od ideas.

Private Sub Image1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
With Dialogs(wdDialogInsertPicture)
.Display
Img1 = .Name
If Left(Img1, 1) = Chr$(34) Then Img1 = Mid(Img1, 2, Len(Img1) - 2)
If Not (Img1 = "" Or Left(Img1, 1) = "*") Then
Set Image1.Picture = LoadPicture(Img1)
Label1.Caption = Img1
End If
Image1.PictureSizeMode = fmPictureSizeModeZoom
End With
End Sub


sophic@uboot.com
 
I wouldn't have guessed that one! Thanks.
Whilst on the subject, when an image is loaded, is it possible to embed it within the document in its native file format and resolution so that when the document is saved as html, the images are extracted in thier original form?

sophic@uboot.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top