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

VBA Macro for adding resized photos by DA

DA
Sun Jul 04 19:41:38 CDT 2004

Hi John

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

Regards,
Dennis

>-----Original Message-----
>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
>
>
>.
>

Re: VBA Macro for adding resized photos by John

John
Mon Jul 05 01:49:22 CDT 2004

Thank you

John

"DA" <infoscene@nospam.winshop.com.au> wrote in message
news:25ab201c46228$d4c85850$a601280a@phx.gbl...
> Hi John
>
> Remove the linktofile and savewithdocument arguments from
> your .range.Copy.
>
> Regards,
> Dennis
>
> >-----Original Message-----
> >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
> >
> >
> >.
> >