VBA Macro for adding resized photos

J

John P

Dear all

I would like to add a resized photo to a word document and have the
following code.
Unfortunately it fails!

Please can you help me with it!

Cheers

John P
North Yorkshire UK

Sub AddPicturefromdirectory()
If Selection.Information(wdWithInTable) Then
Dialogs(wdDialogInsertPicture).Show
With Selection.Cells(1).Range.InlineShapes(1)
.LockAspectRatio = msoTrue
.Width = InchesToPoints(1.4)
.Height = InchesToPoints(1.8)
.Range.Copy linktofile:=False, savewithdocument:=True
End With
Else
' Error Message and Quit
End If
End Sub
 
D

DA

Hi John

Remove the linktofile and savewithdocument arguments from
your .range.Copy.

Regards,
Dennis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top