hak_888
11-04-2012, 07:26 AM
Hey guys,
I have a WORD document, that should allow user to insert multiple images ( using Insert Picture dialog ), after which I should run some VBA code to position and crop images. The problem I have now, is I don't know how to get multiple images selected from dialog. Here's the code I'm using to get the 1 selected image
With oDialog
' \\ Display the dialog
.Display
' \\Insert InlineShape if the Name property (Filepath) <> ""
If .Name <> "" Then
ActiveDocument.Shapes.AddPicture FileName:=.Name, _
LinkToFile:=False, _
SaveWithDocument:=True, _
Left:=5, _
top:=top, _
Width:=50, _
Height:=50, _
Anchor:=Selection.Range
End If
End With
Can you please help me out here, as I'm completely new to VBA. How to change the above code, to get all the selected images ?
Thanks in advance.
I have a WORD document, that should allow user to insert multiple images ( using Insert Picture dialog ), after which I should run some VBA code to position and crop images. The problem I have now, is I don't know how to get multiple images selected from dialog. Here's the code I'm using to get the 1 selected image
With oDialog
' \\ Display the dialog
.Display
' \\Insert InlineShape if the Name property (Filepath) <> ""
If .Name <> "" Then
ActiveDocument.Shapes.AddPicture FileName:=.Name, _
LinkToFile:=False, _
SaveWithDocument:=True, _
Left:=5, _
top:=top, _
Width:=50, _
Height:=50, _
Anchor:=Selection.Range
End If
End With
Can you please help me out here, as I'm completely new to VBA. How to change the above code, to get all the selected images ?
Thanks in advance.