SilverSN95
03-11-2010, 11:00 AM
Hi,
There is probably a very simple solution for this, but I have been looking everywhere and cant seem to find what I need...
I have this macro I am using in a word doc, so users can insert a signature image at the bottom of the document by clicking on an image field.
Private Sub Image1_Click()
Application.ScreenUpdating = False
Dim fname As String
' Display the Open dialog box.
fname = WordApplicationGetOpenFileName("*.*", True, True)
If fname <> "False" Then
On Error Resume Next
Image1.Picture = LoadPicture(fname)
If Err.Number <> 0 Then
MsgBox "Error loading file: " + fname
End If
' ***Refresh.
End If
Application.ScreenUpdating = True
End Sub
Where WordApplicationGetOpenFileName is basically GetOpenFileName for word. The image does load into the image space, but only becomes visible after resizing the window. What to I need to add in the macro so users don't think the image didn't load?
Also, in print preview, I can still see the image container around the loaded image, can I either hide this from printing, or resize the area to match the image?
Thanks!
There is probably a very simple solution for this, but I have been looking everywhere and cant seem to find what I need...
I have this macro I am using in a word doc, so users can insert a signature image at the bottom of the document by clicking on an image field.
Private Sub Image1_Click()
Application.ScreenUpdating = False
Dim fname As String
' Display the Open dialog box.
fname = WordApplicationGetOpenFileName("*.*", True, True)
If fname <> "False" Then
On Error Resume Next
Image1.Picture = LoadPicture(fname)
If Err.Number <> 0 Then
MsgBox "Error loading file: " + fname
End If
' ***Refresh.
End If
Application.ScreenUpdating = True
End Sub
Where WordApplicationGetOpenFileName is basically GetOpenFileName for word. The image does load into the image space, but only becomes visible after resizing the window. What to I need to add in the macro so users don't think the image didn't load?
Also, in print preview, I can still see the image container around the loaded image, can I either hide this from printing, or resize the area to match the image?
Thanks!