G
gwh
Version: 2004 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel Hi everyone,
When I test the macro code below on Word 2004, I get the following error:
Compile error: user-defined type not defined
This only happens when I run the code on my mac. When I test it on a PC with Word 2007, it works fine.
I wondered if someone could run it for me and tell me if you get the same error?
Appreciate any assistance.
Sub GetImage()
Dim dlg As Office.FileDialog
Dim strFilePath As String
Set dlg = Application.FileDialog(msoFileDialogFilePicker)
With dlg
.AllowMultiSelect = False 'Make single selection only
If .Show() 0 Then
strFilePath = .SelectedItems(1)
End If
End With
Selection.InlineShapes.AddPicture FileName:= _
strFilePath, LinkToFile:=False, _
SaveWithDocument:=True
End Sub
When I test the macro code below on Word 2004, I get the following error:
Compile error: user-defined type not defined
This only happens when I run the code on my mac. When I test it on a PC with Word 2007, it works fine.
I wondered if someone could run it for me and tell me if you get the same error?
Appreciate any assistance.
Sub GetImage()
Dim dlg As Office.FileDialog
Dim strFilePath As String
Set dlg = Application.FileDialog(msoFileDialogFilePicker)
With dlg
.AllowMultiSelect = False 'Make single selection only
If .Show() 0 Then
strFilePath = .SelectedItems(1)
End If
End With
Selection.InlineShapes.AddPicture FileName:= _
strFilePath, LinkToFile:=False, _
SaveWithDocument:=True
End Sub