Hi All,

I have the below code to change the image size in a word document through my excel vba, but it is not working. It is showing error as object doesnt ..... CAn anyone resolve the issue with the code?

Dim PercentSize As Integer
'Dim oIshp As Shapes
Dim objWord As Object
Dim objDoc
Dim objSelection
Dim oshp As Shape
Const wdpath As String = "D:\Novartis iDMA Data Migration\ELMUI\ELMUIScreenshot.doc"
'PercentSize = 60 'InputBox("Enter percent of full size", "ResizePicture ", 75)
Set objWord = GetObject("D:\Novartis iDMA Data Migration\ELMUI\ELMUIScreenshot.doc")
Set objDoc = GetObject(wdpath)
Set objSelection = objWord.Selection

With objSelection
For i = 1 To objSelection.InlineShapes.Count
objSelection.InlineShapes.Item(i).LockAspectRatio = msoFalse
objSelection.InlineShapes.Item(i).Height = 525
objSelection.InlineShapes.Item(i).Width = 640
Next i
End With

Thanks,
Selva