|
|
|
date: 1 Dec 2005 01:54:21 -0800,
group: microsoft.public.word.word97vba
back
Re: How to insert a floating picture into a cell
liu_jz@yahoo.com wrote:
> I add a picture into a cell in a table. It slipt the table. I set the
> WrapFormat to wdWrapNone. But the picture is out of the table.
> How can I move the picture into the cell? Or how can I insert a
> picture into a cell?
>
> Thanks advance!
> Liu Jianzhong
>
>
> Dim wdShape As Word.Shape
> Dim wdCell As Word.Cell
>
> Set wdShape = wdDoc.Shapes.AddPicture(strFileName, False, True, , , ,
> , wdCell.Range)
> wdShape.WrapFormat.Type = wdWrapNone
When you're combining a picture and a table, use an InlineShape
(non-floating) instead of a Shape (floating):
Sub PicInTableCell()
Dim wdDoc As Word.Document
Dim wdShape As Word.InlineShape ' <== Note change!
Dim wdCell As Word.Cell
Dim strFileName As String
' for testing purposes:
Set wdDoc = ActiveDocument
Set wdCell = wdDoc.Tables(1).Cell(2, 2)
strFileName = "C:\myPicture.jpg"
' insert as InlineShape instead of Shape:
Set wdShape = wdDoc.InlineShapes.AddPicture( _
FileName:=strFileName, _
Range:=wdCell.Range)
End Sub
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
date: Thu, 1 Dec 2005 10:46:03 -0500
author: Jay Freedman
Re: How to insert a floating picture into a cell
Jay,
Can you do me a huge favor and look at my post - Error 462. I think you can
help me out and I would really appreciate it.
Thanks,
"Jay Freedman" wrote:
> liu_jz@yahoo.com wrote:
> > I add a picture into a cell in a table. It slipt the table. I set the
> > WrapFormat to wdWrapNone. But the picture is out of the table.
> > How can I move the picture into the cell? Or how can I insert a
> > picture into a cell?
> >
> > Thanks advance!
> > Liu Jianzhong
> >
> >
> > Dim wdShape As Word.Shape
> > Dim wdCell As Word.Cell
> >
> > Set wdShape = wdDoc.Shapes.AddPicture(strFileName, False, True, , , ,
> > , wdCell.Range)
> > wdShape.WrapFormat.Type = wdWrapNone
>
> When you're combining a picture and a table, use an InlineShape
> (non-floating) instead of a Shape (floating):
>
> Sub PicInTableCell()
> Dim wdDoc As Word.Document
> Dim wdShape As Word.InlineShape ' <== Note change!
> Dim wdCell As Word.Cell
> Dim strFileName As String
>
> ' for testing purposes:
> Set wdDoc = ActiveDocument
> Set wdCell = wdDoc.Tables(1).Cell(2, 2)
> strFileName = "C:\myPicture.jpg"
>
> ' insert as InlineShape instead of Shape:
> Set wdShape = wdDoc.InlineShapes.AddPicture( _
> FileName:=strFileName, _
> Range:=wdCell.Range)
>
> End Sub
>
> --
> Regards,
> Jay Freedman
> Microsoft Word MVP FAQ: http://word.mvps.org
>
>
>
date: Fri, 2 Dec 2005 13:33:02 -0800
author: Conrad
|
|