Subguy702
03-10-2014, 04:44 PM
I am trying to populate an Activex image control on a Word document, but can't seem to seal the deal. using this code:
_____
Private Sub Image2_Click()
Dim pd As FileDialog
Set pd = Application.FileDialog(msoFileDialogFilePicker)
Dim ImgPck As Variant
With pd
.Filters.Clear
.Filters.Add "Image", "*.jpg", 1
.InitialFileName = "C:\"
If .Show = -1 Then
Image2.Picture = "'" & ImgPck & "'"
Else
End If
End With
Set pd = Nothing
End Sub
As you can see, I can get it to open the file picker, but lack the knowledge to make the Image2 (Image Control) show the image. I keep getting the "object required" error statement.
I'm very new to this, and would appreciate any help I can get. (Hope it's simple, I tend to over-think these things)
Thanks!
ps I just realized I didn't define ImgPck as anything. I tried to equate it to .SelectedItems, but keep getting a Type Mismatch. Oh well...
_____
Private Sub Image2_Click()
Dim pd As FileDialog
Set pd = Application.FileDialog(msoFileDialogFilePicker)
Dim ImgPck As Variant
With pd
.Filters.Clear
.Filters.Add "Image", "*.jpg", 1
.InitialFileName = "C:\"
If .Show = -1 Then
Image2.Picture = "'" & ImgPck & "'"
Else
End If
End With
Set pd = Nothing
End Sub
As you can see, I can get it to open the file picker, but lack the knowledge to make the Image2 (Image Control) show the image. I keep getting the "object required" error statement.
I'm very new to this, and would appreciate any help I can get. (Hope it's simple, I tend to over-think these things)
Thanks!
ps I just realized I didn't define ImgPck as anything. I tried to equate it to .SelectedItems, but keep getting a Type Mismatch. Oh well...