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
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) = "*"
Set Image1.Picture = LoadPicture(Img1)
Label1.Caption = Img1
End If
Image1.PictureSizeMode = fmPictureSizeModeZoom
End With
End Sub
sophic@uboot.com