Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: 1 Dec 2005 01:54:21 -0800,    group: microsoft.public.word.word97vba        back       


How to insert a floating picture into a cell   
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
date: 1 Dec 2005 01:54:21 -0800   author:   unknown

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

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us